PointExtensionMethods
Extension methods for Eto.Drawing.Point and Eto.Drawing.PointF
Methods
Gets the angle (in degrees, measured anti-clockwise) of a size, assuming it represents a vector.
Parameters:
| size (SizeF) |
Create a plane halfway this plane and another.
Measure the distance between this point and another.
Parameters:
| point (Point) | Point to measure distance from. |
| other (Point) | Point to measure distance to. |
Returns: Distance between points.
public static double DistanceTo(this Point point, Point segmentA, Point segmentB, LineExtent extent)
Measure the distance between this point and a line.
Parameters:
| point (Point) | Point to measure distance to. |
| segmentA (Point) | Tier start point. |
| segmentB (Point) | Tier end point. |
| extent (LineExtent) | Line treatment. |
Returns: Distance to finite line segment.
Measure the distance between this point and a rectangle.
Parameters:
| point (Point) | Point to measure distance to. |
| rectangle (Rectangle) | Rectangle for distance measurement. |
Returns: Distance to finite line segment.
Measure the distance between this point and a disc.
Parameters:
| point (PointF) | Point to measure distance to. |
| circle (CircleF) | Circle. |
Returns: Distance to circle.
Measure the distance between this point and another.
Parameters:
| point (PointF) | Point to measure distance from. |
| other (PointF) | Point to measure distance to. |
Returns: Distance between points.
public static double DistanceTo(this PointF point, PointF segmentA, PointF segmentB, LineExtent extent)
Measure the distance between this point and a line.
Parameters:
| point (PointF) | Point to measure distance to. |
| segmentA (PointF) | Tier start point. |
| segmentB (PointF) | Tier end point. |
| extent (LineExtent) | Line treatment. |
Returns: Distance to finite line segment.
Measure the distance between this point and a rectangle.
Parameters:
| point (PointF) | Point to measure distance to. |
| rectangle (RectangleF) | Rectangle for distance measurement. |
Returns: Distance to finite line segment.
Find the tangent lines from this point to a circle.
Find the incidence points between two circles.
Find the incidence point between a line and a circle. The incidence is the average of all intersections, or the point in the circle closest to the line.
Test two points for standard coincidence. Points that are very close together are considered to be coincident.
Parameters:
| point (PointF) | Point. |
| other (PointF) | Other point. |
| threshold (float) | Coincidence threshold. |
Returns: Coincidence.
Test two points for standard coincidence. Points that are very close together are considered to be coincident.
Parameters:
| point (PointF) | Point. |
| other (PointF) | Other point. |
Returns: Coincidence.
Tests whether the coordinates are valid numbers.
Parameters:
| point (PointF) | Point to test. |
Returns: True if both the x and y coordinates are valid numbers.
Tests whether the dimensions are valid numbers.
Parameters:
| size (SizeF) | Size to test. |
Returns: True if both the Width and Height dimensions are valid numbers.
Gets the length of a size, assuming the size represents a vector.
Parameters:
| size (SizeF) | Size to measure. |
Returns: Length of size.
Move a plane along its normal.
Move a plane along a vector.
Move a point in x and y.
Move a point in x and y.
public static PointF Move(this PointF point, SizeF motion)
Move a point in x and y.
Parameters:
| point (PointF) | Point to move. |
| motion (SizeF) | Motion in X and Y. |
Returns: Moved point.
Move a point in x and y.
Parameters:
| point (PointF) | Point to move. |
| target (PointF) | Target point. |
| parameter (float) | Motion factor. |
Returns: Moved point.
public static SizeF Perpendicular(this SizeF size)
Create a perpendicular size, assuming the size represents a vector.
Parameters:
| size (SizeF) | Size to rotate. |
Returns: Perpendicular to size.
public static SizeF[] Perpendiculars(this PointF[] points)
Create an array of unit perpendicular vectors.
Parameters:
| points (PointF[]) | Points to operate on. |
Returns: Array of perpendicular vectors (one per input point).
public static Point ProjectTo(this Point point, PointF segmentA, PointF segmentB, LineExtent extent)
Project this point onto a finite line segment.
Parameters:
| point (Point) | Point to project. |
| segmentA (PointF) | Tier start point. |
| segmentB (PointF) | Tier end point. |
| extent (LineExtent) | Line treatment. |
Returns: Projected point.
public static PointF ProjectTo(this PointF point, PointF segmentA, PointF segmentB, LineExtent extent)
Project this point onto a finite line segment.
Parameters:
| point (PointF) | Point to project. |
| segmentA (PointF) | Tier start point. |
| segmentB (PointF) | Tier end point. |
| extent (LineExtent) | Line treatment. |
Returns: Projected point.
Compute the quadrance between two points.
Compute the quadrance between two points.
Compute the quadrance between two points.
Parameters:
| point (PointF) | Point. |
| other (PointF) | Other point. |
Returns: Quadrance (or distance squared).
Rotate a SizeF assuming it represents a vector.
Parameters:
| size (SizeF) | Size to rotate. |
| angle (float) | Rotation angle (in degrees, anti-clockwise). |
Returns: Rotated size.
Round the coordinates in a point to a number of decimal places.
Round the coordinates of a point.
Parameters:
| point (PointF) | Point to modify. |
| decimals (int) | Number of decimals. |
Returns: Point with coordinates rounded to a specific number of decimal places.
public static PointF Round(this PointF point)
Round a point to integer coordinates.
Parameters:
| point (PointF) | Point to modify. |
Returns: Point with coordinates rounded to nearest integers.
Round the components in a vector to a number of decimal places.
Gets the scaling factor of a graphics object as implied by its transform matrix.
Parameters:
| graphics (Graphics) | Graphics object to inspect. |
Returns: Implied scaling factor.
Gets the scaling factor implied by a matrix.
Parameters:
| matrix (IMatrix) | Matrix to parse. |
Returns: Implied scaling factor.
Create a size structure between two points.
Parameters:
| point (Point) | Start point. |
| other (Point) | end point. |
public static SizeF SizeTo(this PointF point, PointF other)
Create a size structure between two points.
Parameters:
| point (PointF) | Start point. |
| other (PointF) | end point. |
Convert a Point3d into a Point2d.
Parameters:
| point (Point3d) | Point. |
Returns: Point.
Convert a PointF into a Point2d.
Parameters:
| point (PointF) | Point. |
Returns: Point.
Convert an array of Point3d instances to Point2d instances by removing the z-coordinates.
Parameters:
| points (Point3d[]) | Points. |
Returns: Two-dimensional points.
Convert a Point2d into a Point3d.
Parameters:
| point (Point2d) | Point. |
Returns: Point.
Convert a PointF into a Point3d.
Parameters:
| point (PointF) | Point. |
Returns: Point.
Convert an array of Point2d instances to Point3d instances.
Convert an array of Point2d instances to Point3d instances.
Convert an array of Point2d instances to Point3d instances.
Parameters:
| points (Point2d[]) | Points. |
Returns: Three-dimensional points.
Convert a Point3d into a Point3f.
Parameters:
| point (Point3d) | Point. |
Returns: Point.
public static PointF ToGdiPoint(this PointF point)
Convert an Eto point to a GDI point.
Parameters:
| point (PointF) |
Convert a PointF into a Point.
Parameters:
| point (PointF) | Point to convert. |
Returns: Point.
public static SizeF Unitize(this SizeF size)
Unitize a size structure, assuming the size represents a vector.
Parameters:
| size (SizeF) | Size to unitize. |
Returns: Unitized size.
public static void Widen(this PointF[] points, out PointF[] side0, out PointF[] side1, params LineProfile[] profiles)
Thicken a polyline curve.
Parameters:
| points (PointF[]) | Polyline points. |
| side0 (out PointF[]) | Points along the left side of the widened path will be returned here. |
| side1 (out PointF[]) | Points along the right side of the widened path will be returned here. |
| profiles (params LineProfile[]) | Sorted array of profiles. Collection may not contain two or more profiles with the same index, but this is not checked for. |