Geo
Methods
ApproximateArcSegment(ArcSegment, Point, double) : List<Point>
Returns a piecewise linear approximation of the given arcsegment, stepping by epsilon
- arcSeg
- The arc segment to approximate
- ellipseStartPoint
- The point to start the arc segment at
- epsilon
- The x distance between each point
Returns: The list of points that approximate the arc segment
ApproximateBezier(Point, Point, Point, Point, double) : List<Point>
Returns a list of points that approximate bezier [p1-p4] with maximum error of epsilon
- p1
- Start point of the bezier curve
- p2
- First control point of the bezier curve
- p3
- Second control point of the bezier curve
- p4
- End point of the bezier curve
- epsilon
- The maximum amount of error
Returns: A list of points that approximate the bezier curve
ApproximateBezierElevation(Point[], double) : Point[]
Elevate the given Bezier Curve up to degree [epsilon]
- controlPoints
- An array of control points that define a Bezier Curve
- epsilon
- The degree to raise the bezier to
Returns: A list of points that define an elevated Bezier Curve
FigureContainsPointWinding(Point, Point[], Rect) : bool
Determines using the Winding Number method whether [p1] is in the figure defined by [points]
- p1
- points
- bounds
FindClosest(List<Point>, Point) : Point
Returns the closest point to in .
- points
- The list of points checking for distance to source.
- source
- The point we want to be closest to.
Returns: The closest point to .
GeometryContainsPoint(Point, Geometry) : bool
Returns true if [p1] lies inside [geom], false otherwise
- p1
- geom
GeometryContainsPoint(Point, Geometry, bool) : bool
Count intersections on the ray from outside bounding box to p1. If odd, it's in, else it's out (Raycasting)
- p1
- geom
- overrideNonZero
Returns: True if p1 is in the geometry
GeometryContainsPointRaycasting(Point, Geometry) : bool
Determines using raycasting whether or not [p1] lies inside [geom]
- p1
- geom
Returns: True if p1 is in the geometry
GetAngle(double, double) : double
Return the angle of the line going from the origin to a point.
- x
- y
Returns: an angle in degrees, with 0 along the positive X axis, and with 90.0 along the positive Y axis.
GetAngleFromX(Point, Point) : double
Gets the positive angle with repect to center's x axis of [point]
- point
- center
GetIntersectionsOnBezier(Point, Point, Point, Point, Point, Point, List<Point>) : bool
Calculates all intersections between infinite line [p1,p2] and the cubic bezier curve [s,c1,c2,e]
- p1
- First point on the infinite line
- p2
- Second point on the infinite line
- s
- The start point of the Bezier Curve
- c1
- The first control point of the Bezier Curve
- c2
- The second control point of the Bezier Curve
- e
- The end of the Bezier Curve
- intersections
- The list of intersections
Returns: True if there are any intersections; false otherwise
GetIntersectionsOnGeometry(Geometry, Point, Point, List<Point>) : bool
Returns all intersections between infinite line [p1-p2] and [geom] and puts them in [result]
- geom
- The geometry to find intersections with
- p1
- First point on the infinite line
- p2
- Second point on the infinite line
- result
- The list of intersections
Returns: True if intersections are found; false otherwise
GetIntersectionsOnGeometry(Geometry, Point, Point, List<Point>, bool) : bool
Returns all intersections between infinite line [p1-p2] and [geom] and puts them in [result]
- geom
- The geometry to find intersections with
- p1
- First point on the infinite line
- p2
- Second point on the infinite line
- result
- The list of intersections
- mustBeFilled
- True if each figure must be filled to be included
Returns: True if intersections are found; false otherwise
GetIntersectionsOnPathGeometry(PathGeometry, Point, Point, List<Point>, bool) : bool
Returns a point on [path] that is the closest intersection of the path and the line formed by p1/p2
- path
- The Path Geometry to find intersections with
- p1
- First point on the infinite line
- p2
- Second point on the infinite line
- result
- The list of intersection points
- mustBeFilled
- True if each figure must be filled to be included
Returns: True if intersections are found; false otherwise
GetIntersectionsOnRect(Rect, Point, Point, List<Point>) : bool
Returns all intersections between infinite line [p1-p2] and [rect] and puts them in [result]
- rect
- The Rect to check for intersections
- p1
- First point on the infinite line
- p2
- Second point on the infinite line
- result
- The list of intersections
Returns: True if intersections are found; false otherwise
GetKeyPointsInPathGeometry(PathGeometry) : List<Point>
Returns a list of points that approximate the pathgeometry [pg]
- pg
- The path geometry to approximate
Returns: A list of points that approximate the path geometry
GetLineArcSegmentIntersections(Point, Point, Point, ArcSegment, List<Point>) : bool
Returns all intersections between infinite line [line1-line2] and the ArcSegment and puts them in [result]
- line1
- First point on the infinite line
- line2
- Second point on the infinite line
- ellipseStartPoint
- The start point of the arc segment
- arcSeg
- The arc segment to find intersections with
- intersection
- The list to return the intersections with
Returns: Returns true if their are any intersections; false otherwise
GetLineEllipseIntersections(Point, Point, EllipseGeometry) : List<Point>
Returns all intersections between infinite line [line1-line2] and [ellipse] and returns them
- line1
- First point on the infinite line
- line2
- Second point on the infinite line
- ellipse
- The ellipse we are checking for intersections with
Returns: A list of intersection points
GetNearestIntersectionPoint(Rect, Point, Point, Point) : bool
Find the closest point of a rectangle to a given point that is on a line from that point.
- rect
- p1
- the point we are looking to be closest to, on the line formed with
- p2
- forms a line with
- result
- the point of this object that is closest to and that is on the infinite line from to
Returns: true if the infinite line does intersect with the rectangle; false otherwise
GetPolyBezierIntersections(Point, Point, Point, PointCollection, double, List<Point>) : bool
Returns all intersections between infinite line [line1-line2] and the PolyBezier and puts them in [result]
- line1
- First point of the infinite line
- line2
- Second point of the infinite line
- start
- First point of the PolyBezier
- points
- List of points in the PolyBezier
- epsilon
- Accuracy tolerance
- result
- The list of intersections
Returns: True if intersections are found; false otherwise
GetPolyLineSegIntersections(Point, Point, Point, PointCollection, List<Point>) : bool
Returns all intersections of infinite line [line1-line2] and the polyline defined by [start] and [points]
- line1
- First point of the infinite line
- line2
- Second point of the infinite line
- start
- First point of the polyline
- points
- List of line segments
- result
- The list of intersections
Returns: True if intersections are found; false otherwise
GetPolyQuadBezierIntersection(Point, Point, Point, PointCollection, double, List<Point>) : bool
Returns all intersections between infinite line [line1-line2] and the PolyBezier and puts them in [result]
- line1
- First point of the infinite line
- line2
- Second point of the infinite line
- start
- First point of the PolyQuadBezier
- points
- List of points in the PolyQuadBezier
- epsilon
- Accuracy tolerance
- result
- The list of intersections
Returns: True if intersections are found; false otherwise
GetQuadBezierIntersectionsOnLine(Point, Point, Point, Point, Point, double, List<Point>) : bool
Returns all intersections between infinite line [l1-l2] and the QuadBezier and puts them in [result]
- s
- Start point of the bezier curve
- c1
- First control point of the bezier curve
- e
- End point of the bezier curve
- l1
- First point of the infinite line
- l2
- Second point of the infinite line
- epsilon
- Accuracy tolerance
- result
- List of the intersections
Returns: True if intersections are found; false otherwise
GetRootsOfCubic(double, double, double, double) : List<double>
Returns a list of the 3 roots of a cubic equation of the form at^3 + bt^2 + ct + d
- a
- b
- c
- d
Returns: A list of the roots
InfiniteLineContainsPoint(Point, Point, Point, double) : bool
Returns true if [point] is within [fuzz] pixels of the infinite line passing through [p1] and [p2]
- p1
- Point 1 on the infinite line
- p2
- Point 2 on the infinite line
- point
- The point we're checking to be on the line
- fuzz
- The number of pixels away [point] can be from the line
Returns: True if [point] is on or within [fuzz] pixels of the line, false otherwise
LargestSizeKeepingAspectRatio(Size, Size) : Size
Compute a Size that fits in while maintaining the aspect ratio given by .
- target
- aspect
- if both width and height are zero or negative, assume 1x1
LineIntersectsWithSegment(Point, Point, Point, Point, List<Point>) : bool
Returns true if line(line1, line2) intersects with line segment(seg1, seg2) and sets [intersection] to the point
- line1
- line2
- seg1
- seg2
- intersection
NearestIntersectionOnArc(Rect, Point, Point, Point, double, double) : bool
Find the intersection point of the elliptical path defined by rectangle rect and an infinite line p1-p2 that is closest to point p1 within the area from startAngle through the sweepAngle.
- rect
- p1
- p2
- result
- startAngle
- sweepAngle
NearestIntersectionOnEllipse(Rect, Point, Point, Point) : bool
Find the intersection point of the elliptical path defined by rectangle rect and an infinite line p1-p2 that is closest to point p1.
- rect
- p1
- p2
- result
NearestIntersectionOnLine(Point, Point, Point, Point, Point) : bool
Find the intersection point of the finite line segment A-B and the infinite line P-Q that is closest to point P.
- a
- b
- p
- q
- result
NearestPointOnLine(Point, Point, Point, Point) : bool
Return a point on a straight line segment that is closest to a given point.
- a
- One end of the line.
- b
- The other end of the line.
- p
- The point to be closest to.
- result
- A Point that is on the finite length straight line segment from to
Returns: true if the point is on a perpendicular line to the line segment; false if the point is beyond either end of the line segment. When this returns false, the will be either or .
OnscreenElementContainsPoint(Point, FrameworkElement) : bool
Returns true if [fe] contains [p]. [fe] must be onscreen.
- p
- Point in [fe]'s coordinates
- fe
- The framework element to test
Returns: True if [fe] contains [p] else false
RotatePoint(Point, double) : Point
Rotates the point [p] about (0,0)
- p
- The point to be rotated
- angle
- The angle to rotate the point in degrees (Counter-Clockwise is positive)
ScalePoint(Point, double, double) : Point
Scales the given point by scaleX, scaleY
- pt
- The point to be scaled
- scaleX
- The amount to scale the point in the x direction
- scaleY
- The amount to scale the point in the y direction
Returns: The scaled point
SubdivideBezier(Point, Point, Point, Point, List<Point>, double)
Breaks the bezier up into line segments that are a maximum of sqrt(epsilon) away from the original curve
- p1
- Start point of the bezier curve
- p2
- First control point of the bezier curve
- p3
- Second control point of the bezier curve
- p4
- End point of the bezier curve
- result
- The list of line segments
- epsilon
- The square of the maximum amount of deviation from the original curve
TranslatePoint(Point, double, double) : Point
Translates the point by transX, transY
- pt
- The point to be translated
- transX
- The amount to translate in the x direction
- transY
- The amount to translate in the y direction
Returns: The translated point
TranslatePoints(IEnumerable<Point>, double, double) : IEnumerable<Point>
Translates a collection of points by transX, transY
- pts
- The collection to be translated
- transX
- The amount to translate in the x direction
- transY
- The amount to translate in the y direction
Returns: The translated collection