Class PointMathExtensions
- Namespace
- Splat
- Assembly
- Splat.dll
Extension methods which extend the point mathematics.
public static class PointMathExtensions
- Inheritance
-
PointMathExtensions
Methods
AngleInDegrees(PointF)
Calculates the angle in degrees of a PointF.
public static float AngleInDegrees(this PointF value)
Parameters
value
PointFThe point value to use for the calculation.
Returns
- float
The angle that has been generated.
DistanceTo(PointF, PointF)
Calculates the distance between two points.
public static float DistanceTo(this PointF value, PointF other)
Parameters
value
PointFThe point value to use for the calculation.
other
PointFThe other point to generate for.
Returns
- float
The distance to the other point.
DotProduct(PointF, PointF)
Calculates the Dot product of two points.
public static float DotProduct(this PointF value, PointF other)
Parameters
value
PointFThe point value to use for the calculation.
other
PointFThe point to perform the dot product against.
Returns
- float
The calculated dot product.
Floor(Point)
Floor the specified point (i.e. round it to integer values).
public static PointF Floor(this Point value)
Parameters
value
PointThe point value to use for the calculation.
Returns
- PointF
The point that has been floored.
Length(PointF)
Calculates the magnitude of a point from (0,0).
public static float Length(this PointF value)
Parameters
value
PointFThe point value to use for the calculation.
Returns
- float
The length of the point.
Normalize(PointF)
Normalize the specified PointF (i.e. makes its magnitude = 1.0f).
public static PointF Normalize(this PointF value)
Parameters
value
PointFThe point value to use for the calculation.
Returns
- PointF
The normalized point.
ProjectAlong(PointF, PointF)
Projects a PointF along a specified direction.
public static PointF ProjectAlong(this PointF value, PointF direction)
Parameters
value
PointFThe point value to use for the calculation.
direction
PointFThe point containing the direction.
Returns
- PointF
The projected point.
ProjectAlongAngle(PointF, float)
Projects a PointF along a specified angle.
public static PointF ProjectAlongAngle(this PointF value, float angleInDegrees)
Parameters
value
PointFThe point value to use for the calculation.
angleInDegrees
floatThe angle in degrees to perform the projection against.
Returns
- PointF
The point that has been projected.
ScaledBy(PointF, float)
Scales a PointF by a scalar factor.
public static PointF ScaledBy(this PointF value, float factor)
Parameters
Returns
- PointF
The scaled point.
WithinEpsilonOf(PointF, PointF, float)
Determines whether two points are within 'epsilon' of each other.
public static bool WithinEpsilonOf(this PointF value, PointF other, float epsilon)
Parameters
value
PointFThe point value to use for the calculation.
other
PointFThe point to compare against.
epsilon
floatThe tolerated epsilon value.
Returns
- bool
If the value is equal based on the epsilon.