PointExtensionMethods

public static class PointExtensionMethods
Extension methods for Eto.Drawing.Point and Eto.Drawing.PointF

Methods

public static float Angle(this SizeF size)
Gets the angle (in degrees, measured anti-clockwise) of a size, assuming it represents a vector.
size (SizeF)

Average

#Example
public static Plane Average(this Plane plane, Plane other)
Create a plane halfway this plane and another.
plane (Plane)This plane.
other (Plane)Other plane.
Average plane.

DistanceTo

#Example
public static double DistanceTo(this Point point, Point other)
Measure the distance between this point and another.
point (Point)Point to measure distance from.
other (Point)Point to measure distance to.
Distance between points.

DistanceTo

#Example
public static double DistanceTo(this Point point, Point segmentA, Point segmentB, LineExtent extent)
Measure the distance between this point and a line.
point (Point)Point to measure distance to.
segmentA (Point)Tier start point.
segmentB (Point)Tier end point.
extent (LineExtent)Line treatment.
Distance to finite line segment.

DistanceTo

#Example
public static double DistanceTo(this Point point, Rectangle rectangle)
Measure the distance between this point and a rectangle.
point (Point)Point to measure distance to.
rectangle (Rectangle)Rectangle for distance measurement.
Distance to finite line segment.

DistanceTo

#Example
public static double DistanceTo(this PointF point, CircleF circle)
Measure the distance between this point and a disc.
point (PointF)Point to measure distance to.
circle (CircleF)Circle.
Distance to circle.

DistanceTo

#Example
public static double DistanceTo(this PointF point, PointF other)
Measure the distance between this point and another.
point (PointF)Point to measure distance from.
other (PointF)Point to measure distance to.
Distance between points.

DistanceTo

#Example
public static double DistanceTo(this PointF point, PointF segmentA, PointF segmentB, LineExtent extent)
Measure the distance between this point and a line.
point (PointF)Point to measure distance to.
segmentA (PointF)Tier start point.
segmentB (PointF)Tier end point.
extent (LineExtent)Line treatment.
Distance to finite line segment.

DistanceTo

#Example
public static double DistanceTo(this PointF point, RectangleF rectangle)
Measure the distance between this point and a rectangle.
point (PointF)Point to measure distance to.
rectangle (RectangleF)Rectangle for distance measurement.
Distance to finite line segment.

FindTangents

#Example
public static bool FindTangents(this Point3d point, Circle circle, out Line tan0, out Line tan1, out string failure)
Find the tangent lines from this point to a circle.
point (Point3d)Point.
circle (Circle)Circle.
tan0 (out Line)First tangent line.
tan1 (out Line)Second tangent line.
failure (out string)Description in case of failure.
True if tangents could be found.

FindTangentsEx

#Example
public static bool FindTangentsEx(this Circle circleA, Circle circleB, out Line tan0, out Line tan1, out string failure)
circleA (Circle)
circleB (Circle)
tan0 (out Line)
tan1 (out Line)
failure (out string)

FindTangentsIn

#Example
public static bool FindTangentsIn(this Circle circleA, Circle circleB, out Line tan0, out Line tan1, out string failure)
circleA (Circle)
circleB (Circle)
tan0 (out Line)
tan1 (out Line)
failure (out string)

Incidence

#Example
public static bool Incidence(this Circle a, Circle b, out Point3d p, out Point3d q)
Find the incidence points between two circles.
a (Circle)First circle.
b (Circle)Second circle.
p (out Point3d)First incidence point.
q (out Point3d)Second incidence point.

Incidence

#Example
public static bool Incidence(this Circle circle, Line line, out Point3d point)
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.
circle (Circle)Circle.
line (Line)Line.
point (out Point3d)Incidence point.

IsCoincident

#Example
public static bool IsCoincident(this PointF point, PointF other, float threshold)
Test two points for standard coincidence. Points that are very close together are considered to be coincident.
point (PointF)Point.
other (PointF)Other point.
threshold (float)Coincidence threshold.
Coincidence.

IsCoincident

#Example
public static bool IsCoincident(this PointF point, PointF other)
Test two points for standard coincidence. Points that are very close together are considered to be coincident.
point (PointF)Point.
other (PointF)Other point.
Coincidence.

IsValid

#Example
public static bool IsValid(this PointF point)
Tests whether the coordinates are valid numbers.
point (PointF)Point to test.
True if both the x and y coordinates are valid numbers.

IsValid

#Example
public static bool IsValid(this SizeF size)
Tests whether the dimensions are valid numbers.
size (SizeF)Size to test.
True if both the Width and Height dimensions are valid numbers.

Length

#Example
public static float Length(this SizeF size)
Gets the length of a size, assuming the size represents a vector.
size (SizeF)Size to measure.
Length of size.
public static Plane Move(this Plane plane, double amount)
Move a plane along its normal.
plane (Plane)
amount (double)
public static Plane Move(this Plane plane, Vector3d amount)
Move a plane along a vector.
plane (Plane)
amount (Vector3d)
public static Point Move(this Point point, int dx, int dy)
Move a point in x and y.
point (Point)Point to move.
dx (int)Motion along X.
dy (int)Motion along Y.
Moved point.
public static PointF Move(this PointF point, float dx, float dy)
Move a point in x and y.
point (PointF)Point to move.
dx (float)Motion along X.
dy (float)Motion along Y.
Moved point.
public static PointF Move(this PointF point, SizeF motion)
Move a point in x and y.
point (PointF)Point to move.
motion (SizeF)Motion in X and Y.
Moved point.

MoveTo

#Example
public static PointF MoveTo(this PointF point, PointF target, float parameter)
Move a point in x and y.
point (PointF)Point to move.
target (PointF)Target point.
parameter (float)Motion factor.
Moved point.

Perpendicular

#Example
public static SizeF Perpendicular(this SizeF size)
Create a perpendicular size, assuming the size represents a vector.
size (SizeF)Size to rotate.
Perpendicular to size.

Perpendiculars

#Example
public static SizeF[] Perpendiculars(this PointF[] points)
Create an array of unit perpendicular vectors.
points (PointF[])Points to operate on.
Array of perpendicular vectors (one per input point).

ProjectTo

#Example
public static Point ProjectTo(this Point point, PointF segmentA, PointF segmentB, LineExtent extent)
Project this point onto a finite line segment.
point (Point)Point to project.
segmentA (PointF)Tier start point.
segmentB (PointF)Tier end point.
extent (LineExtent)Line treatment.
Projected point.

ProjectTo

#Example
public static PointF ProjectTo(this PointF point, PointF segmentA, PointF segmentB, LineExtent extent)
Project this point onto a finite line segment.
point (PointF)Point to project.
segmentA (PointF)Tier start point.
segmentB (PointF)Tier end point.
extent (LineExtent)Line treatment.
Projected point.

QuadranceTo

#Example
public static double QuadranceTo(this Point2d point, Point2d other)
Compute the quadrance between two points.
point (Point2d)Point.
other (Point2d)Other point.
Quadrance (or distance squared).

QuadranceTo

#Example
public static double QuadranceTo(this Point3d point, Point3d other)
Compute the quadrance between two points.
point (Point3d)Point.
other (Point3d)Other point.
Quadrance (or distance squared).

QuadranceTo

#Example
public static float QuadranceTo(this PointF point, PointF other)
Compute the quadrance between two points.
point (PointF)Point.
other (PointF)Other point.
Quadrance (or distance squared).

Rotate

#Example
public static SizeF Rotate(this SizeF size, float angle)
Rotate a SizeF assuming it represents a vector.
size (SizeF)Size to rotate.
angle (float)Rotation angle (in degrees, anti-clockwise).
Rotated size.
public static Point3d Round(this Point3d point, int digits)
Round the coordinates in a point to a number of decimal places.
point (Point3d)Point to round.
digits (int)Number of digits (0, 15).
Rounded point.
public static PointF Round(this PointF point, int decimals)
Round the coordinates of a point.
point (PointF)Point to modify.
decimals (int)Number of decimals.
Point with coordinates rounded to a specific number of decimal places.
public static PointF Round(this PointF point)
Round a point to integer coordinates.
point (PointF)Point to modify.
Point with coordinates rounded to nearest integers.
public static Vector3d Round(this Vector3d vector, int digits)
Round the components in a vector to a number of decimal places.
vector (Vector3d)Vector to round.
digits (int)Number of digits (0, 15).
Rounded vector.

ScaleFactor

#Example
public static float ScaleFactor(this Graphics graphics)
Gets the scaling factor of a graphics object as implied by its transform matrix.
graphics (Graphics)Graphics object to inspect.
Implied scaling factor.

ScaleFactor

#Example
public static float ScaleFactor(this IMatrix matrix)
Gets the scaling factor implied by a matrix.
matrix (IMatrix)Matrix to parse.
Implied scaling factor.

SizeTo

#Example
public static Size SizeTo(this Point point, Point other)
Create a size structure between two points.
point (Point)Start point.
other (Point)end point.

SizeTo

#Example
public static SizeF SizeTo(this PointF point, PointF other)
Create a size structure between two points.
point (PointF)Start point.
other (PointF)end point.
public static Point2d To2d(this Point3d point)
Convert a Point3d into a Point2d.
point (Point3d)Point.
Point.
public static Point2d To2d(this PointF point)
Convert a PointF into a Point2d.
point (PointF)Point.
Point.
public static Point2d[] To2d(this Point3d[] points)
Convert an array of Point3d instances to Point2d instances by removing the z-coordinates.
points (Point3d[])Points.
Two-dimensional points.
public static Point3d To3d(this Point2d point)
Convert a Point2d into a Point3d.
point (Point2d)Point.
Point.
public static Point3d To3d(this PointF point)
Convert a PointF into a Point3d.
point (PointF)Point.
Point.
public static Point3d[] To3d(this Point2d[] points, double[] elevationData)
Convert an array of Point2d instances to Point3d instances.
points (Point2d[])Points.
elevationData (double[])Z values.
Three-dimensional points.
public static Point3d[] To3d(this Point2d[] points, Point3d[] elevationData)
Convert an array of Point2d instances to Point3d instances.
points (Point2d[])Points.
elevationData (Point3d[])Point array for extracting z values.
Three-dimensional points.
public static Point3d[] To3d(this Point2d[] points)
Convert an array of Point2d instances to Point3d instances.
points (Point2d[])Points.
Three-dimensional points.
public static Point3f To3f(this Point3d point)
Convert a Point3d into a Point3f.
point (Point3d)Point.
Point.

ToGdiPoint

#Example
public static PointF ToGdiPoint(this PointF point)
Convert an Eto point to a GDI point.
point (PointF)

ToPoint

#Example
public static Point ToPoint(this PointF point)
Convert a PointF into a Point.
point (PointF)Point to convert.
Point.

ToPointF

#Example
public static PointF ToPointF(this Point2d point)
Convert a Point2d to a PointF.
point (Point2d)Point.
XY projection of point.

ToPointF

#Example
public static PointF ToPointF(this Point3d point)
Convert a Point3d to a PointF.
point (Point3d)Point.
XY projection of point.

ToPointF

#Example
public static PointF[] ToPointF(this IEnumerable<Point3d> points)
Convert a collection of points into a PointF array.
points (IEnumerable<Point3d>)

ToPointFArray

#Example
public static PointF[] ToPointFArray(this float[] array)
Convert an array of consecutive (x,y) coordinates into a PointF array.
array (float[])

Unitize

#Example
public static SizeF Unitize(this SizeF size)
Unitize a size structure, assuming the size represents a vector.
size (SizeF)Size to unitize.
Unitized size.
public static void Widen(this PointF[] points, out PointF[] side0, out PointF[] side1, params LineProfile[] profiles)
Thicken a polyline curve.
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.