New to Telerik UI for WPF? Start a free 30-day trial

Utils

Class

Global utilities and functions.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

C#
public static class Utils

Inheritance: objectUtils

Fields

An infinitesimal value.

C#
public const double Epsilon = 1E-06

Methods

Approximates the arc.

C#
public static IEnumerable<Point> ApproximateArc(Point topLeft, Point bottomRight, double startAngle, double endAngle)
Parameters:topLeftPoint

The topLeft.

bottomRightPoint

The bottomRight.

startAngledouble

The angle in degrees at which the arc starts.

endAngledouble

The angle in degrees at which the arc ends.

Returns:

IEnumerable<Point>

Approximates the Bezier curve as segments represented by a series of points.

C#
public static IEnumerable<Point> ApproximateBezierCurve(Point[] bezierPoints, int quality)
Parameters:bezierPointsPoint[]

The Bezier points.

qualityint

The quality of the approximation. The greater the value, the more accurate approximation (more approximated points).

Returns:

IEnumerable<Point>

Approximates the ellipse defined by the given bounds.

C#
public static IList<Point> ApproximateEllipse(this Rect rec, double minSegmentLength = 10)
Parameters:recRect

The bounds of the (not rotated) ellipse.

minSegmentLengthdouble

The minimum length an approximating segment should have.

Returns:

IList<Point>

Approximates the rounded rectangle.

C#
public static IEnumerable<Point> ApproximateRoundedRectangle(double x, double y, double width, double height, double radius)
Parameters:xdouble

The x-coordinate.

ydouble

The y-coordinate.

widthdouble

The width.

heightdouble

The height.

radiusdouble

The radius of the rounding.

Returns:

IEnumerable<Point>

Approximates the rounded rectangle.

C#
public static IEnumerable<Point> ApproximateRoundedRectangle(Rect rectangle, double radius)
Parameters:rectangleRectradiusdoubleReturns:

IEnumerable<Point>

Arcs the convert.

C#
public static void ArcConvert(Rect rect, double startAngle, double sweep, out Point startPoint, out Point outsidePoint, out bool largeArc, out SweepDirection dir)
Parameters:rectRect

The rec.

startAngledouble

The start angle.

sweepdouble

The sweep.

startPointPoint

The start point.

outsidePointPoint

The outside point.

largeArcbool

If set to true [large arc].

dirSweepDirection

The direction.

Checks whether two values are close.

C#
public static bool AreClose(double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

Returns whether the line (line segments) intersect and returns in the crossingPoint the actual crossing point if they do.

C#
public static bool AreLinesIntersecting(Point line1Start, Point line1End, Point line2Start, Point line2End, ref Point crossingPoint)
Parameters:line1StartPoint

The first point of the first line.

line1EndPoint

The second point of the first line.

line2StartPoint

The first point of the second line.

line2EndPoint

The second point of the second line.

crossingPointPoint

The crossing point.

Returns:

bool

Returns the barycentric coordinates as percentages with respect to the given rectangle.

C#
public static Point BarycentricPercentageFromPoint(Point realPoint, Rect rectangle)
Parameters:realPointPoint

The real point.

rectangleRect

The rectangle which acts as a barycentric coordinate system.

Returns:

Point

The percentages wrapped in a Point.

Tells you whether the given value sits in the specified interval.

C#
public static bool BetweenOrEqual(double value, double lower, double upper)
Parameters:valuedouble

The value.

lowerdouble

The lower.

upperdouble

The upper.

Returns:

bool

Converts the Cartesian coordinates to polar coordinates.

C#
public static void CartesianToPolar(Point rootPoint, Point otherPoint, ref double angle, ref double rho)
Parameters:rootPointPointotherPointPointangledoublerhodouble

Given an interval and a value this will output the value which is closer to the given value.

C#
public static void Closer(double value, double choice1, double choice2, out double nearestValue, out double otherValue)
Parameters:valuedouble

The value.

choice1double

The first choice.

choice2double

The second choice.

nearestValuedouble

The nearest value.

otherValuedouble

The other value.

Given an interval and a value this will output the value which is closer to the given value.

C#
public static double Closer(double value, double choice1, double choice2)
Parameters:valuedoublechoice1doublechoice2doubleReturns:

double

Returns the point of the interval which sits the closest to the given point.

C#
public static Point Closer(Point point, Point point1, Point point2)
Parameters:pointPoint

The point seeking the closes neighbor.

point1Point

The first point in the interval.

point2Point

The second point in the interval.

Returns:

Point

Coerces the given angle. The return angle will be between 0 and 360.

C#
public static double CoerceAngle(double angle)
Parameters:angledouble

The angle.

Returns:

double

Constrains the specified value to the given interval.

C#
public static double Constrain(this double value, double min, double max)
Parameters:valuedouble

The value to constrain.

mindouble

The min.

maxdouble

The max.

Returns:

double

Returns the vector between the two points.

C#
public static Vector Delta(this Point point1, Point point2)
Parameters:point1Point

The point where the vector starts.

point2Point

The points where the vector ends.

Returns:

Vector

Determinants the specified point1.

C#
public static double Determinant(Point point1, Point point2)
Parameters:point1Point

The point1.

point2Point

The point2.

Returns:

double

Returns the distance of the point to the origin.

C#
public static double Distance(double x, double y)
Parameters:xdoubleydoubleReturns:

double

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.

C#
public static Point DistancePoint(Point point, Point lineStart, Point lineEnd)
Parameters:pointPoint

The point outside the segment.

lineStartPoint

The first point defining the segment.

lineEndPoint

The second point defining the segment.

Returns:

Point

Returns the squared distance between the given points.

C#
public static double DistanceSquared(Point point1, Point point2)
Parameters:point1Pointpoint2PointReturns:

double

Returns the dot product of the specified points.

C#
public static double Dot(Point point1, Point point2)
Parameters:point1Pointpoint2PointReturns:

double

Returns the dot product of the specified vectors.

C#
public static double Dot(Vector vector1, Vector vector2)
Parameters:vector1Vectorvector2VectorReturns:

double

Gets a double value from mantissa and exponent.

C#
public static double DoubleFromMantissaAndExponent(double value, int exp)
Parameters:valuedouble

The value.

expint

The exponential.

Returns:

double

Ensures the range.

C#
public static double EnsureRange(double value, double? min, double? max)
Parameters:valuedouble

The value.

mindouble?

The min.

maxdouble?

The max.

Returns:

double

Finds the angle between three points.

C#
public static double FindAngle(Point firstPoint, Point centralPoint, Point secondPoint)
Parameters:firstPointPointcentralPointPointsecondPointPointReturns:

double

Finds the angle between two points.

C#
public static double FindAngle(Point start, Point end)
Parameters:startPointendPointReturns:

double

Finds the intersection point of a shape and the line segment defined by the point segmentStart and segmentEnd.

C#
public static Point FindIntersectionPoint(this Rect rec, double angle, Point segmentStart, Point segmentEnd, GlidingStyle style)
Parameters:recRect

The bounding rectangle of the shape.

angledouble

The rotation angle.

segmentStartPoint

The line point which is supposedly inside the shape defined by rec.

segmentEndPoint

The other line point which supposedly sits outside the bounds define by rec.

styleGlidingStyle

The gliding style.

Returns:

Point

Finds the intersection point of the lines defined by the point pairs.

C#
public static Point FindLinesIntersection(Point line1Start, Point line1End, Point line2Start, Point line2End, bool acceptNaN = false)
Parameters:line1StartPointline1EndPointline2StartPointline2EndPointacceptNaNboolReturns:

Point

The intersection point. If acceptNaN is true line1Start double.NaN is returned if they don't intersect.

Finds the radian between three points.

C#
public static double FindRadian(Point firstPoint, Point centralPoint, Point secondPoint)
Parameters:firstPointPointcentralPointPointsecondPointPointReturns:

double

Finds the radian between two points.

C#
public static double FindRadian(Point start, Point end)
Parameters:startPointendPointReturns:

double

Gets the name of the assembly.

C#
public static string GetAssemblyName(this Assembly assembly)
Parameters:assemblyAssembly

The assembly.

Returns:

string

Gets the Bezier point at the specified value.

C#
public static Point GetBezierPoint(Collection<Point> points, int segment, double value)
Parameters:pointsCollection<Point>

The points.

segmentint

The segment.

valuedouble

A value in the interval [0,1].

Returns:

Point

Gets a point from the maximum X and Y values from the specified points.

C#
public static Point GetBottomRightPoint(IEnumerable<Point> points)
Parameters:pointsIEnumerable<Point>

The points.

Returns:

Point

Gets the enclosing bounds of the points collection.

C#
public static Rect GetBounds(this IList<Point> points)
Parameters:pointsIList<Point>

The points collection.

Returns:

Rect

Gets the only the child elements.

C#
public static IEnumerable<XElement> GetChildElements(this XElement element)
Parameters:elementXElement

The parent element.

Returns:

IEnumerable<XElement>

Returns the point at an angle on the ellipse defined by the specified rectangle.

C#
public static Point GetEllipsePointAtAngle(this Rect rect, double angle)
Parameters:rectRect

The rect.

angledouble

The angle in degrees.

Returns:

Point

Gets the enumeration values.

C#
public static T[] GetEnumValues<T>()
Returns:

T[]

Gets the normalization point.

C#
public static Point GetNormalizationPoint(this IEnumerable<Point> points)
Parameters:pointsIEnumerable<Point>

The points.

Returns:

Point

Gets the normalized points.

C#
public static IEnumerable<Point> GetNormalizedPoints(this IEnumerable<Point> points)
Parameters:pointsIEnumerable<Point>

The points.

Returns:

IEnumerable<Point>

Gets the projected points of the specified point on the given rectangle.

C#
public static void GetProjections(Point point, Rect rectangle, Point[] projections)
Parameters:pointPointrectangleRectprojectionsPoint[]

Gets the equal sides of a triangle from the Pythagor theorem.

C#
public static double GetPythagorEqualSide(double hypotenuse)
Parameters:hypotenusedouble

The hypotenuse.

Returns:

double

Gets the hypotenuse according to the Pythagoras theorem.

C#
public static double GetPythagorHypotenuse(double sideA, double sideB)
Parameters:sideAdouble

The first side.

sideBdouble

The second side.

Returns:

double

Gets a point from the minimum X and Y values from the specified points.

C#
public static Point GetTopLeftPoint(IEnumerable<Point> points)
Parameters:pointsIEnumerable<Point>

The points.

Returns:

Point

Determines whether [has valid area] [the specified size].

C#
public static bool HasValidArea(this Size size)
Parameters:sizeSize

The size.

Returns:

bool

true if [has valid area] [the specified size]; otherwise, false.

Hypotenuses the specified x.

C#
public static double Hypotenuse(double x, double y)
Parameters:xdouble

The x.

ydouble

The y.

Returns:

double

Determines whether the specified line segments intersect.

C#
public static bool Intersect(Point[] points)
Parameters:pointsPoint[]Returns:

bool

True if the segments intersect, false if not.

Calculate the intersection point between a polyline and a line segment.

C#
public static bool IntersectionPointOnEllipse(Collection<Point> points, Point org, Point end, ref Point result)
Parameters:pointsCollection<Point>orgPointendPointresultPointReturns:

bool

Calculate the intersection point between an ellipse and a line segment.

C#
public static void IntersectionPointOnEllipse(Rect rect, Point lineStart, Point lineEnd, ref Point result)
Parameters:rectRectlineStartPointlineEndPointresultPoint

Calculates the intersection point between the specified rectangle and the line segment defined by the specified points.

C#
public static void IntersectionPointOnRectangle(Rect rectangle, Point lineStart, Point lineEnd, ref Point intersectionPoint)
Parameters:rectangleRectlineStartPointlineEndPointintersectionPointPoint

Inverts the point.

C#
public static Point InvertPoint(this Point point)
Parameters:pointPoint

The point.

Returns:

Point

Determines, given three points, if when travelling from the first to the second to the third, we travel in a counterclockwise direction.

C#
public static int IsCounterClockWise(Point point1, Point point2, Point point3)
Parameters:point1Pointpoint2Pointpoint3PointReturns:

int

Remarks:

1 if the movement is in a counterclockwise direction, -1 if not.

Determines whether the specified values are equal with Epsilon approximation.

C#
public static bool IsEqual(this double value1, double value2)
Parameters:value1double

The first value.

value2double

The second value.

Returns:

bool

True if the specified values are equal with Epsilon approximation; otherwise, false.

Determines whether [is finite double] [the specified x].

C#
public static bool IsFiniteDouble(double x)
Parameters:xdouble

The x.

Returns:

bool

True if [is finite double] [the specified x]; otherwise, false.

Determines whether [is greater than] [the specified value1].

C#
public static bool IsGreaterThan(double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

True if [is greater than] [the specified value1]; otherwise, false.

Determines whether [is greater than or close] [the specified value1].

C#
public static bool IsGreaterThanOrClose(double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

True if [is greater than or close] [the specified value1]; otherwise, false.

Determines whether the specified value is in the specified closed interval.

C#
public static bool IsInClosedInterval(this double value, double min, double max)
Parameters:valuedoublemindoublemaxdoubleReturns:

bool

Determines whether the specified value is in the specified right open interval.

C#
public static bool IsInRightOpenInterval(this double value, double min, double max)
Parameters:valuedoublemindoublemaxdoubleReturns:

bool

Determines whether [is less or equal] [the specified value1].

C#
public static bool IsLessOrEqual(this double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

True If [is less or equal] [the specified value1]; otherwise, false.

Determines whether [is less than] [the specified value1].

C#
public static bool IsLessThan(double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

True if [is less than] [the specified value1]; otherwise, false.

Determines whether [is less than or close] [the specified value1].

C#
public static bool IsLessThanOrClose(double value1, double value2)
Parameters:value1double

The value1.

value2double

The value2.

Returns:

bool

True if [is less than or close] [the specified value1]; otherwise, false.

Gets whether the value is double or infinity.

C#
public static bool IsNanOrInfinity(this double value)
Parameters:valuedoubleReturns:

bool

Gets whether the value is NaN or infinite point.

C#
public static bool IsNanOrInfinity(this Point value)
Parameters:valuePointReturns:

bool

Determines whether the specified values are not equal with Epsilon approximation.

C#
public static bool IsNotEqual(this double value1, double value2)
Parameters:value1double

The first value.

value2double

The second value.

Returns:

bool

True if the specified values are not equal with Epsilon approximation; otherwise, false.

Returns whether the specified point is inside the ellipse defined by the specified rectangle.

C#
public static bool IsPointInEllipse(Point point, Rect rectangle)
Parameters:pointPointrectangleRectReturns:

bool

Determines whether [is point in rectangle] [the specified point].

C#
public static bool IsPointInRectangle(Point point, Size size)
Parameters:pointPoint

The point.

sizeSize

The size.

Returns:

bool

true if [is point in rectangle] [the specified point]; otherwise, false.

Determines whether [is very small] [the specified value].

C#
public static bool IsVerySmall(this double value)
Parameters:valuedouble

The value.

Returns:

bool

true if [is very small] [the specified value]; otherwise, false.

Returns the length of the given point considered as a vector.

C#
public static double Length(this Point point)
Parameters:pointPointReturns:

double

Linear interpolation between the two given values.

C#
public static double Lerp(double x, double y, double alpha)
Parameters:xdouble

The value to be returned when alpha is zero.

ydouble

The value to be returned when alpha is equal to one.

alphadouble

The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.

Returns:

double

Linear interpolation between the two given points.

C#
public static Point Lerp(Point pointA, Point pointB, double alpha)
Parameters:pointAPoint

The value to be returned when alpha is zero.

pointBPoint

The value to be returned when alpha is equal to one.

alphadouble

The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.

Returns:

Point

Linear interpolation between the two given vectors.

C#
public static Vector Lerp(Vector vectorA, Vector vectorB, double alpha)
Parameters:vectorAVector

The value to be returned when alpha is zero.

vectorBVector

The value to be returned when alpha is equal to one.

alphadouble

The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.

Returns:

Vector

Moves the given point into the rectangle by taking the rectangle's intervals as limiting values for the point's coordinates.

C#
public static Point Limit(this Point point, Rect rectangle)
Parameters:pointPoint

Any point.

rectangleRect

A rectangle which acts as limiting container.

Returns:

Point

Returns the middle point between the given points.

C#
public static Point MiddlePoint(Point point1, Point point2)
Parameters:point1Point

A point.

point2Point

Another point.

Returns:

Point

Halfway between the two given points.

Returns the mirrored vector with respect to the X-coordinate.

C#
public static Vector MirrorHorizontally(this Vector vector)
Parameters:vectorVector

The vector to mirror.

Returns:

Vector

The mirrored vector.

Returns the opposite of point point with respect to specified line.

C#
public static Point MirrorPoint(Point point, Point lineStart, Point lineEnd)
Parameters:pointPointlineStartPointlineEndPointReturns:

Point

Mirrors the point with respect to the given center.

C#
public static Point MirrorPoint(Point point, Point center)
Parameters:pointPointcenterPointReturns:

Point

Returns the mirrored vector with respect to the Y-coordinate.

C#
public static Vector MirrorVertically(this Vector vector)
Parameters:vectorVector

The vector to mirror.

Returns:

Vector

The mirrored vector.

Calculates the intersection points with each of the given segments and determines the one nearest to the first point.

C#
public static bool NearestIntersectionPoint(Point segmentStart, Point segmentEnd, IList<Point> points, ref Point result)
Parameters:segmentStartPointsegmentEndPointpointsIList<Point>resultPointReturns:

bool

Returns true if a point (non-NaN values) is found, otherwise false.

Gets the nearest point.

C#
public static Point NearestPoint(this Point point, IEnumerable<Point> points)
Parameters:pointPoint

The point.

pointsIEnumerable<Point>

The points.

Returns:

Point

Normalize the specified point1.

C#
public static Vector Normal(Point point1, Point point2)
Parameters:point1Point

The point1.

point2Point

The point2.

Returns:

Vector

Normalizes the specified angle into the [0, 2Pi] interval.

C#
public static double NormalizeAngle(double angle)
Parameters:angledouble

The angle.

Returns:

double

The normalize.

Normalize the specified vector.

C#
public static Vector Normalized(this Vector vector)
Parameters:vectorVector

The vector.

Returns:

Vector

Offsets the specified points.

C#
public static IList<Point> Offset(this IEnumerable<Point> points, Vector offsetVector)
Parameters:pointsIEnumerable<Point>

The points.

offsetVectorVector

The offset vector.

Returns:

IList<Point>

Offsets the point collection.

C#
public static void Offset(IList<Point> points, IList<Point> originalPoints, Vector offset)
Parameters:pointsIList<Point>

The points.

originalPointsIList<Point>

The original points.

offsetVector

The offset.

Returns the perpendicular of the specified vector.

C#
public static Vector Perpendicular(this Vector vector)
Parameters:vectorVector

A vector.

Returns:

Vector

Given a percentage and a rectangle this will return the coordinates corresponding to the percentages given.

C#
public static Point PointFromBarycentricPercentage(Point percentage, Rect rectangle)
Parameters:percentagePoint

A couple of values in percentage, e.g. a value of (50,50) will return the center of the rectangle.

rectangleRect

The rectangle which acts as the barycentric system.

Returns:

Point

The point corresponding to the barycentric coordinates.

Given rect1 percentage and a rectangle this will return the coordinates corresponding to the percentages given.

C#
public static Point PointFromBarycentricPercentage(Point percentage, Size size)
Parameters:percentagePoint

A couple of values in percentage, e.g. a value of (50,50) will return the center of the rectangle.

sizeSize

The size from which the point will be extracted.

Returns:

Point

The point corresponding to the barycentric coordinates.

Gets a point extending the line by a specified distance.

C#
public static Point PointOnLine(Point startPoint, Point endPoint, double distance)
Parameters:startPointPoint

The start point.

endPointPoint

The end point.

distancedouble

The distance.

Returns:

Point

Polar to cartesian coordinates conversion.

C#
public static Point PolarToCartesian(Point coordinateCenter, double angle, double rho)
Parameters:coordinateCenterPoint

The coordinate center.

angledouble

The angle.

rhodouble

The polar radius.

Returns:

Point

The opposite of the approximation method, this attempts to smoothen out the polyline to a Bezier curve.

C#
public static IEnumerable<Point> PolylineToBezier(Collection<Point> points)
Parameters:pointsCollection<Point>

The polyline.

Returns:

IEnumerable<Point>

Finds the projection (point) of the given point on the line.

C#
public static Point ProjectPointOnLine(Point point, Point lineStart, Point lineEnd)
Parameters:pointPointlineStartPointlineEndPointReturns:

Point

Pushes the specified start point onwards in the direction specified by the vector and a length given.

C#
public static Point Push(Point start, Vector unitVector, double distance)
Parameters:startPoint

The start.

unitVectorVector

The unit vector.

distancedouble

The distance to push.

Returns:

Point

Rotates the points.

C#
public static IList<Point> RotatePointsAt(IList<Point> points, Point pivot, double angle)
Parameters:pointsIList<Point>pivotPointangledoubleReturns:

IList<Point>

Rotates the transform.

C#
public static RotateTransform RotateTransform(Point center, double angle)
Parameters:centerPoint

The center.

angledouble

The angle.

Returns:

RotateTransform

Safes the divide.

C#
public static double SafeDivide(double value1, double value2, double fallback)
Parameters:value1double

The value1.

value2double

The value2.

fallbackdouble

The fallback.

Returns:

double

Determine whether point1 and point2 are on the same side of a line.

C#
public static bool SameSide(Point lineStart, Point lineEnd, Point point1, Point point2)
Parameters:lineStartPointlineEndPointpoint1Pointpoint2PointReturns:

bool

Checks whether the segments defined by the specified point pairs intersect and returns the intersection point.

C#
public static bool SegmentIntersect(Point segmentStart, Point segmentEnd, Point lineStart, Point lineEnd, ref Point result)
Parameters:segmentStartPointsegmentEndPointlineStartPointlineEndPointresultPointReturns:

bool

Snaps the specified value.

C#
public static double Snap(this double value, int snappingValue)
Parameters:valuedouble

The value.

snappingValueint

The snapping value.

Returns:

double

Squares the specified value.

C#
public static double Square(double value)
Parameters:valuedouble

Any value.

Returns:

double

Returns zero within the given interval and +/-1 whether the value is above or below the interval.

C#
public static int StairValue(double value, double lower, double upper)
Parameters:valuedouble

The argument of the function.

lowerdouble

The lower value of the interval.

upperdouble

The upper value of the interval.

Returns:

int

Zero, -1 or +1 whether the value is below, inside, or above the interval.

Returns the StairValue(double, double, double) of the x,y values of the given point with respect to the boundaries of the specified rectangle.

C#
public static Vector StairValue(Point point, Rect rectangle)
Parameters:pointPoint

The point to test.

rectangleRect

The rectangle which acts as the domain of the stair function.

Returns:

Vector

Zero, -1 or +1 whether the coordinate is below, inside, or above the boundary of the rectangle.

Swaps the values of the two numbers.

C#
public static void Swap(ref double value1, ref double value2)
Parameters:value1double

A value.

value2double

Another value.

Swaps the values of the two points.

C#
public static void Swap(ref Point point1, ref Point point2)
Parameters:point1Point

A point.

point2Point

Another point.

Converts the specified value from radians to degrees.

C#
public static double ToDegrees(this double radians)
Parameters:radiansdoubleReturns:

double

DoubleCollection from a string representation.

C#
public static DoubleCollection ToDoubleCollection(string value)
Parameters:valuestringReturns:

DoubleCollection

Returns value of the enumeration.

C#
public static T ToEnum<T>(object value)
Parameters:valueobject

The value.

Returns:

T

Converts the double to a string representation.

C#
public static string ToInvariant(this double value)
Parameters:valuedouble

The value.

Returns:

string

Converts the double collection to a string representation.

C#
public static string ToInvariant(this DoubleCollection collection)
Parameters:collectionDoubleCollection

The collection.

Returns:

string

Returns a string serialization of the given point collection.

C#
public static string ToInvariant(this IList<Point> points)
Parameters:pointsIList<Point>

The points.

Returns:

string

Converts the integer to a string representation.

C#
public static string ToInvariant(this int value)
Parameters:valueint

The value.

Returns:

string

Converts the point to a string representation.

C#
public static string ToInvariant(this Point point)
Parameters:pointPoint

The point.

Returns:

string

Converts the point to a string representation.

C#
public static string ToInvariant(this Size size)
Parameters:sizeSize

The size.

Returns:

string

Attempts to convert the given string to a points.

C#
public static Point? ToPoint(string point)
Parameters:pointstring

The string representation of the point.

Returns:

Point?

The Point corresponding to the serialized form.

Attempts to convert the given string to a list of points.

C#
public static IList<Point> ToPoints(string points)
Parameters:pointsstring

The string representation of the points.

Returns:

IList<Point>

The points corresponding to the serialized form.

Converts the specified value from degrees to radians.

C#
public static double ToRadians(this double degrees)
Parameters:degreesdoubleReturns:

double

Return a rectangle located a (0.0) with the specified size.

C#
public static Rect ToRect(this Size size)
Parameters:sizeSize

The s.

Returns:

Rect

A rectangle located at the (0.0).

Sizes from string.

C#
public static Size? ToSize(string size)
Parameters:sizestringReturns:

Size?

Returns a unit point in the direction defined by the given point.

C#
public static Point ToUnit(this Point point)
Parameters:pointPointReturns:

Point

Unions two rectangles.

C#
public static Rect Union(Rect rect1, Rect rect2)
Parameters:rect1Rect

The first rectangle.

rect2Rect

The second rectangle.

Returns:

Rect

Union of the two rectangles.

Returns a unit vector in the direction specified by the angle.

C#
public static Vector UnitVector(double degrees)
Parameters:degreesdouble

The angle in degrees.

Returns:

Vector

A unit vector.

Uppercases the first letter of the string.

C#
public static string UppercaseFirstLetter(this string value)
Parameters:valuestring

An arbitrary string.

Returns:

string

In this article
DefinitionFieldsEpsilonMethodsApproximateArc(Point, Point, double, double)ApproximateBezierCurve(Point[], int)ApproximateEllipse(Rect, double)ApproximateRoundedRectangle(double, double, double, double, double)ApproximateRoundedRectangle(Rect, double)ArcConvert(Rect, double, double, out Point, out Point, out bool, out SweepDirection)AreClose(double, double)AreLinesIntersecting(Point, Point, Point, Point, ref Point)BarycentricPercentageFromPoint(Point, Rect)BetweenOrEqual(double, double, double)CartesianToPolar(Point, Point, ref double, ref double)Closer(double, double, double, out double, out double)Closer(double, double, double)Closer(Point, Point, Point)CoerceAngle(double)Constrain(double, double, double)Delta(Point, Point)Determinant(Point, Point)Distance(double, double)DistancePoint(Point, Point, Point)DistanceSquared(Point, Point)Dot(Point, Point)Dot(Vector, Vector)DoubleFromMantissaAndExponent(double, int)EnsureRange(double, double?, double?)FindAngle(Point, Point, Point)FindAngle(Point, Point)FindIntersectionPoint(Rect, double, Point, Point, GlidingStyle)FindLinesIntersection(Point, Point, Point, Point, bool)FindRadian(Point, Point, Point)FindRadian(Point, Point)GetAssemblyName(Assembly)GetBezierPoint(Collection<Point>, int, double)GetBottomRightPoint(IEnumerable<Point>)GetBounds(IList<Point>)GetChildElements(XElement)GetEllipsePointAtAngle(Rect, double)GetEnumValues<T>()GetNormalizationPoint(IEnumerable<Point>)GetNormalizedPoints(IEnumerable<Point>)GetProjections(Point, Rect, Point[])GetPythagorEqualSide(double)GetPythagorHypotenuse(double, double)GetTopLeftPoint(IEnumerable<Point>)HasValidArea(Size)Hypotenuse(double, double)Intersect(Point[])IntersectionPointOnEllipse(Collection<Point>, Point, Point, ref Point)IntersectionPointOnEllipse(Rect, Point, Point, ref Point)IntersectionPointOnRectangle(Rect, Point, Point, ref Point)InvertPoint(Point)IsCounterClockWise(Point, Point, Point)IsEqual(double, double)IsFiniteDouble(double)IsGreaterThan(double, double)IsGreaterThanOrClose(double, double)IsInClosedInterval(double, double, double)IsInRightOpenInterval(double, double, double)IsLessOrEqual(double, double)IsLessThan(double, double)IsLessThanOrClose(double, double)IsNanOrInfinity(double)IsNanOrInfinity(Point)IsNotEqual(double, double)IsPointInEllipse(Point, Rect)IsPointInRectangle(Point, Size)IsVerySmall(double)Length(Point)Lerp(double, double, double)Lerp(Point, Point, double)Lerp(Vector, Vector, double)Limit(Point, Rect)MiddlePoint(Point, Point)MirrorHorizontally(Vector)MirrorPoint(Point, Point, Point)MirrorPoint(Point, Point)MirrorVertically(Vector)NearestIntersectionPoint(Point, Point, IList<Point>, ref Point)NearestPoint(Point, IEnumerable<Point>)Normal(Point, Point)NormalizeAngle(double)Normalized(Vector)Offset(IEnumerable<Point>, Vector)Offset(IList<Point>, IList<Point>, Vector)Perpendicular(Vector)PointFromBarycentricPercentage(Point, Rect)PointFromBarycentricPercentage(Point, Size)PointOnLine(Point, Point, double)PolarToCartesian(Point, double, double)PolylineToBezier(Collection<Point>)ProjectPointOnLine(Point, Point, Point)Push(Point, Vector, double)RotatePointsAt(IList<Point>, Point, double)RotateTransform(Point, double)SafeDivide(double, double, double)SameSide(Point, Point, Point, Point)SegmentIntersect(Point, Point, Point, Point, ref Point)Snap(double, int)Square(double)StairValue(double, double, double)StairValue(Point, Rect)Swap(ref double, ref double)Swap(ref Point, ref Point)ToDegrees(double)ToDoubleCollection(string)ToEnum<T>(object)ToInvariant(double)ToInvariant(DoubleCollection)ToInvariant(IList<Point>)ToInvariant(int)ToInvariant(Point)ToInvariant(Size)ToPoint(string)ToPoints(string)ToRadians(double)ToRect(Size)ToSize(string)ToUnit(Point)Union(Rect, Rect)UnitVector(double)UppercaseFirstLetter(string)
Not finding the help you need?
Contact Support