simple-geom
Rust Library with simple plane geometry
Provided Classes
Supported operations
Point2D
; /** return the sum of point & vector **/
; /** return the vector difference between two points **/
; /** transform point to radius-vector; the same as difference between point and origin **/
; /** return the distance between points **/
Vector2D
; /** return the length of vector **/
; /** return the sum of vectors **/
; /** mutably add second vector to the given **/
; /** return scaled by k vector **/
; /** return dot product result for the vectors **/
; /** return cross product result for the 2d vectors **/
; /** return scaled to the lenght=1 vector if possible **/
; /** return vector perpendicular to the given one **/
Segment2D
; /** return the intersection relation (with intersection point if needed) for 2 segments **/
; /** return the intersection relation (with intersection point if needed) for given segment and the line **/
Line2D
; /** check either point lies on the given line **/
; /** check the way which segment relates to the given line (Intersects, Left, LeftTouch, Right, RightTouch, OnLine) **/
Polygon2D
; /** return the number of segments for the given polygon **/
+ '_; /** iterate over the vertices of the given polygon **/
; /** return the intersection of polygon and semiplane **/
; /** mutable version of polygon and semiplane intersection **/
; /** prune the polygon by removing too small edges (by given tolerance) **/