In This Article

PointExtensions Class

Provides extension methods for the type System.Windows.Point.

public static class PointExtensions
Inheritance:
object object

Methods

GetDegreeAngle(Point, Point)

Returns the degree angle between a center System.Windows.Point and another System.Windows.Point location.

public static double GetDegreeAngle(this Point centerPosition, Point position)
Parameter Type Description
centerPosition Point

The center System.Windows.Point.

position Point

The System.Windows.Point location to examine.

Returns

double:

The degree angle between a center System.Windows.Point and another System.Windows.Point location.

GetRadiusPointAtRotation(Point, double, double)

Returns the System.Windows.Point location relative to a center System.Windows.Point for a degree angle at the specified radius.

public static Point GetRadiusPointAtRotation(this Point centerPosition, double angle, double radius)
Parameter Type Description
centerPosition Point

The center System.Windows.Point.

angle double

The angle, in degrees (0 - 359.99).

radius double

The radius.

Returns

Point:

The System.Windows.Point location for a degree angle at the specified radius.

IsEffectivelyEqual(Point, Point)

Determines whether the two values are close enough to be considered equal.

public static bool IsEffectivelyEqual(this Point left, Point right)
Parameter Type Description
left Point

The value on the left side of the comparison.

right Point

The value on the left side of the comparison.

Returns

bool:

true if the two values are close enough to be considered equal; otherwise, false.

IsWithin(Point, Point, double)

Determines whether the two values are within a specified range.

public static bool IsWithin(this Point left, Point right, double difference)
Parameter Type Description
left Point

The value on the left side of the comparison.

right Point

The value on the left side of the comparison.

difference double

The difference threshold.

Returns

bool:

true if the two values within a specified range; otherwise, false.

Midpoint(Point, Point)

Gets the mid-point between the specified points.

public static Point Midpoint(this Point point, Point otherPoint)
Parameter Type Description
point Point

The first point.

otherPoint Point

The second point.

Returns

Point:

The mid-point between the specified points.

Inherited Members