﻿Utils Methods
 Utils Methods

The Utils type exposes the following members.

Methods
NameDescription
ApproximateArc
Approximates the arc.
ApproximateBezierCurve
Approximates the Bezier curve as segments represented by a series of points.
ApproximateEllipse
Approximates the ellipse defined by the given bounds.
ApproximateRoundedRectangle(Rect, Double)
Approximates the rounded rectangle.
ApproximateRoundedRectangle(Double, Double, Double, Double, Double)
Approximates the rounded rectangle.
ArcConvert
Arcs the convert.
AreClose
Checks whether two values are close.
AreLinesIntersecting
Returns whether the line (line segments) intersect and returns in the crossingPoint the actual crossing point if they do.
BarycentricPercentageFromPoint
Returns the barycentric coordinates as percentages with respect to the given rectangle.
BetweenOrEqual
Tells you whether the given value sits in the specified interval.
CartesianToPolar
Converts the Cartesian coordinates to polar coordinates.
Closer(Double, Double, Double)
Given an interval and a value this will output the value which is closer to the given value.
Closer(Point, Point, Point)
Returns the point of the interval which sits the closest to the given point.
Closer(Double, Double, Double, Double, Double)
Given an interval and a value this will output the value which is closer to the given value.
CoerceAngle
Coerces the given angle. The return angle will be between 0 and 360.
Constrain
Constrains the specified value to the given interval.
Delta
Returns the vector between the two points.
Determinant
Determinants the specified point1.
Distance
Returns the distance of the point to the origin.
DistancePoint
Calculates the point of the specified line segment which determines the distance from the specified point to the line segment. That is, the perpendicular projection onto the segment.
DistanceSquared
Returns the squared distance between the given points.
Dot(Point, Point)
Returns the dot product of the specified points.
Dot(Vector, Vector)
Returns the dot product of the specified vectors.
DoubleFromMantissaAndExponent
Gets a double value from mantissa and exponent.
EnsureRange
Ensures the range.
FindAngle
Finds the angle between two points.
FindIntersectionPoint
Finds the intersection point of a shape and the line segment defined by the point segmentStart and segmentEnd.
FindLinesIntersection
Finds the intersection point of the lines defined by the point pairs.
Finds the radian between two points.
FromLtrd Obsolete.
Creates a new rectangle from the left top and right bottom coordinates.
GetAssemblyName
Gets the name of the assembly.
GetBezierPoint
Gets the Bezier point at the specified value.
GetBottomRightPoint
Gets a point from the maximum X and Y values from the specified points.
GetChildElements
Gets the only the child elements.
GetEllipsePointAtAngle
Returns the point at an angle on the ellipse defined by the specified rectangle.
GetEnumValuesT
Gets the enumeration values.
GetNormalizationPoint
Gets the normalization point.
GetNormalizedPoints
Gets the normalized points.
GetProjections
Gets the projected points of the specified point on the given rectangle.
GetPythagorEqualSide
Gets the equal sides of a triangle from the Pythagor theorem.
GetPythagorHypotenuse
Gets the hypotenuse according to the Pythagoras theorem.
GetTopLeftPoint
Gets a point from the minimum X and Y values from the specified points.
HasValidArea
Determines whether [has valid area] [the specified size].
Hypotenuse
Hypotenuses the specified x.
Intersect
Determines whether the specified line segments intersect.
IntersectionPointOnEllipse(CollectionPoint, Point, Point, Point)
Calculate the intersection point between a polyline and a line segment.
IntersectionPointOnEllipse(Rect, Point, Point, Point)
Calculate the intersection point between an ellipse and a line segment.
IntersectionPointOnRectangle
Calculates the intersection point between the specified rectangle and the line segment defined by the specified points.
InvertPoint
Inverts the point.
IsCounterClockWise
Determines, given three points, if when travelling from the first to the second to the third, we travel in a counterclockwise direction.
IsEqual
Determines whether the specified values are equal with Epsilon approximation.
IsFiniteDouble
Determines whether [is finite double] [the specified x].
IsGreaterThan
Determines whether [is greater than] [the specified value1].
IsGreaterThanOrClose
Determines whether [is greater than or close] [the specified value1].
IsInClosedInterval
Determines whether the specified value is in the specified closed interval.
IsInRightOpenInterval
Determines whether the specified value is in the specified right open interval.
IsLessOrEqual
Determines whether [is less or equal] [the specified value1].
IsLessThan
Determines whether [is less than] [the specified value1].
IsLessThanOrClose
Determines whether [is less than or close] [the specified value1].
IsNanOrInfinity(Double)
Gets whether the value is double or infinity.
IsNanOrInfinity(Point)
Gets whether the value is NaN or infinite point.
IsNotEqual
Determines whether the specified values are not equal with Epsilon approximation.
IsPointInEllipse
Returns whether the specified point is inside the ellipse defined by the specified rectangle.
IsPointInRectangle(Point, Rect) Obsolete.
Determines whether [is point in rectangle] [the specified point].
IsPointInRectangle(Point, Size)
Determines whether [is point in rectangle] [the specified point].
IsVerySmall
Determines whether [is very small] [the specified value].
Length
Returns the length of the given point considered as a vector.
Lerp(Double, Double, Double)
Linear interpolation between the two given values.
Lerp(Point, Point, Double)
Linear interpolation between the two given points.
Lerp(Vector, Vector, Double)
Linear interpolation between the two given vectors.
Limit
Moves the given point into the rectangle by taking the rectangle's intervals as limiting values for the point's coordinates.
MiddlePoint
Returns the middle point between the given points.
MirrorHorizontally
Returns the mirrored vector with respect to the X-coordinate.
MirrorPoint(Point, Point)
Mirrors the point with respect to the given center.
MirrorPoint(Point, Point, Point)
Returns the opposite of point point with respect to specified line.
MirrorVertically
Returns the mirrored vector with respect to the Y-coordinate.
NearestIntersectionPoint
Calculates the intersection points with each of the given segments and determines the one nearest to the first point.
NearestPoint
Gets the nearest point.
Normal
Normalize the specified point1.
NormalizeAngle
Normalizes the specified angle into the [0, 2Pi] interval.
Normalized
Normalize the specified vector.
Offset(IEnumerablePoint, Vector)
Offsets the specified points.
Offset(IListPoint, IListPoint, Vector)
Offsets the point collection.
Perpendicular
Returns the perpendicular of the specified vector.
PointFromBarycentricPercentage(Point, Rect)
Given a percentage and a rectangle this will return the coordinates corresponding to the percentages given.
PointFromBarycentricPercentage(Point, Size)
Given rect1 percentage and a rectangle this will return the coordinates corresponding to the percentages given.
PointOnLine
Gets a point extending the line by a specified distance.
PolarToCartesian
Polar to cartesian coordinates conversion.
PolylineToBezier
The opposite of the approximation method, this attempts to smoothen out the polyline to a Bezier curve.
ProjectPointOnLine
Finds the projection (point) of the given point on the line.
Push
Pushes the specified start point onwards in the direction specified by the vector and a length given.
RotatePointsAt
Rotates the points.
RotateTransform
Rotates the transform.
SafeDivide
Safes the divide.
SameSide
Determine whether point1 and point2 are on the same side of a line.
SegmentIntersect
Checks whether the segments defined by the specified point pairs intersect and returns the intersection point.
Snap
Snaps the specified value.
Square
Squares the specified value.
StairValue(Point, Rect)
Returns the StairValue(Double, Double, Double) of the x,y values of the given point with respect to the boundaries of the specified rectangle.
StairValue(Double, Double, Double)
Returns zero within the given interval and +/-1 whether the value is above or below the interval.
Swap(Double, Double)
Swaps the values of the two numbers.
Swap(Point, Point)
Swaps the values of the two points.
ToDegrees
Converts the specified value from radians to degrees.
ToDoubleCollection
DoubleCollection from a string representation.
ToEnumT
Returns value of the enumeration.
ToHexColor
ToInvariant(Double)
Converts the double to a string representation.
ToInvariant(SizeF)
ToInvariant(Int32)
Converts the integer to a string representation.
ToInvariant(DoubleCollection)
Converts the double collection to a string representation.
ToInvariant(IListPoint)
Returns a string serialization of the given point collection.
ToInvariant(Point)
Converts the point to a string representation.
ToInvariant(Size)
Converts the point to a string representation.
ToPoint
Attempts to convert the given string to a points.
ToPoints
Attempts to convert the given string to a list of points.
Converts the specified value from degrees to radians.
ToRect
Return a rectangle located a (0.0) with the specified size.
ToSize
Sizes from string.
ToUnit
Returns a unit point in the direction defined by the given point.
Union
Unions two rectangles.
UnitVector
Returns a unit vector in the direction specified by the angle.
UppercaseFirstLetter
Uppercases the first letter of the string.
Top