a library implementation of geometrical objects
.Net 5.0.102 sdk or greater
https://www.nuget.org/packages/EMDD.KtGeometry/
<PackageReference Include="EMDD.KtGeometry" Version="1.*.*" />
- this library can be used to represent geometrical objects such as lines and plane as class type.
- Vectors can be 2D or 3D through
EMDD.KtGeometry.KtVectors.KtVector2D
andEMDD.KtGeometry.KtVectors.KtVector3D
respectively.
- Points can be 2D or 3D through
EMDD.KtGeometry.KtPoints.KtPoint2D
andEMDD.KtGeometry.KtPoints.KtPoint3D
respectively.
- Lines can be of type
KtLine2D
,KtRay2D
,KtSegment2D
, orKtLine3D
var line = new EMDD.KtGeometry.KtLines._2D.KtLine2D(2,3,-12, 3);
var startPoint = new EMDD.KtGeometry.KtPoints.KtPoint2D(2,3);
var direction = new EMDD.KtGeometry.KtVectors.KtVector2D(-1,4);
var endPoint = new EMDD.KtGeometry.KtPoints.KtPoint2D(5,5);
var ray = new EMDD.KtGeometry.KtLines._2D.KtRay2D(startPoint, direction);
var segment = new EMDD.KtGeometry.KtLines._2D.KtSegment2D(startPoint, endPoint);
- Line methods includes line properties such as angle, intersepts and calculation of intersection points, distance from a point
- plane object
var plane = new EMDD.KtGeometry.KtPlanes.KtPlane(2,3,-12, 3); //2x + 3y - 12z = 3
- able to calculate intesection with plane and line
- polygons bound by edges
// a polygon contains a list of regions, where these regions can be +(addition/solid) or -(deductive/hollow)
var startPoint = new EMDD.KtGeometry.KtPoints.KtPoint2D(2,3);
var rectRegion = EMDD.KtGeometry.KtPolygons.CreateSpecialRegionMethods.Rectangle(startPoint, 20, 40, true);
var plane = new EMDD.KtGeometry.KtPolygons.KtPolygon2D(rectRegion);
- Polygon method includes:
- Area calculation
- Polygon clipping
- Translation/rotation
- representation of graphical rotation and orientation of objects
var quatern= new KtQuaternion(w, x, y,z);
- better documentation