PointExtensionMethods

public static class 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.
public static float Angle(
this SizeF
size
)

Average

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

DistanceTo

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

DistanceTo

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

DistanceTo

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

DistanceTo

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

DistanceTo

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

DistanceTo

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

DistanceTo

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

FindTangents

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

FindTangentsEx

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

FindTangentsIn

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

Incidence

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

Incidence

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

IsCoincident

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

IsCoincident

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

IsValid

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

IsValid

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

Length

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

MoveTo

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

Perpendicular

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

Perpendiculars

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

ProjectTo

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

ProjectTo

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

QuadranceTo

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

QuadranceTo

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

QuadranceTo

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

Rotate

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

ScaleFactor

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

ScaleFactor

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

SizeTo

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

SizeTo

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

ToGdiPoint

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

ToPoint

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

ToPointF

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

ToPointF

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

ToPointF

#Example
Convert a collection of points into a PointF array.
public static PointF[] ToPointF(
points
)

ToPointFArray

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

Unitize

#Example
Unitize a size structure, assuming the size represents a vector.
public static SizeF Unitize(
this SizeF
size
Size to unitize.
)
Unitized size.
Thicken a polyline curve.
public static void Widen(
this PointF[]
points,
Polyline points.
out PointF[]
side0,
Points along the left side of the widened path will be returned here.
out PointF[]
side1,
Points along the right side of the widened path will be returned here.
params LineProfile[]
profiles
Sorted array of profiles. Collection may not contain two or more profiles with the same index, but this is not checked for.
)