ClassUtils
Global utilities and functions.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public static class Utils
Inheritance: objectUtils
Fields
Methods
ApproximateArc(Point, Point, double, double)
Approximates the arc.
Declaration
public static IEnumerable<Point> ApproximateArc(Point topLeft, Point bottomRight, double startAngle, double endAngle)
Parameters
topLeft
Point
The topLeft.
bottomRight
Point
The bottomRight.
startAngle
The angle in degrees at which the arc starts.
endAngle
The angle in degrees at which the arc ends.
Returns
IEnumerable<Point>
ApproximateBezierCurve(Point[], int)
Approximates the Bezier curve as segments represented by a series of points.
Declaration
public static IEnumerable<Point> ApproximateBezierCurve(Point[] bezierPoints, int quality)
Parameters
bezierPoints
Point[]
The Bezier points.
quality
The quality of the approximation. The greater the value, the more accurate approximation (more approximated points).
Returns
IEnumerable<Point>
ApproximateEllipse(Rect, double)
Approximates the ellipse defined by the given bounds.
ApproximateRoundedRectangle(Rect, double)
Approximates the rounded rectangle.
Declaration
public static IEnumerable<Point> ApproximateRoundedRectangle(Rect rectangle, double radius)
Parameters
rectangle
Rect
radius
Returns
IEnumerable<Point>
ApproximateRoundedRectangle(double, double, double, double, double)
Approximates the rounded rectangle.
Declaration
public static IEnumerable<Point> ApproximateRoundedRectangle(double x, double y, double width, double height, double radius)
Parameters
x
The x-coordinate.
y
The y-coordinate.
width
The width.
height
The height.
radius
The radius of the rounding.
Returns
IEnumerable<Point>
ArcConvert(Rect, double, double, out Point, out Point, out bool, out SweepDirection)
Arcs the convert.
Declaration
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
public static void ArcConvert(Rect rect, double startAngle, double sweep, out Point startPoint, out Point outsidePoint, out bool largeArc, out SweepDirection dir)
Parameters
rect
Rect
The rec.
startAngle
The start angle.
sweep
The sweep.
startPoint
Point
The start point.
outsidePoint
Point
The outside point.
largeArc
If set to true [large arc].
dir
SweepDirection
The direction.
AreClose(double, double)
Checks whether two values are close.
AreLinesIntersecting(Point, Point, Point, Point, ref Point)
Returns whether the line (line segments) intersect and returns in the crossingPoint the actual crossing point if they do.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static bool AreLinesIntersecting(Point line1Start, Point line1End, Point line2Start, Point line2End, ref Point crossingPoint)
Parameters
line1Start
Point
The first point of the first line.
line1End
Point
The second point of the first line.
line2Start
Point
The first point of the second line.
line2End
Point
The second point of the second line.
crossingPoint
Point
The crossing point.
Returns
BarycentricPercentageFromPoint(Point, Rect)
Returns the barycentric coordinates as percentages with respect to the given rectangle.
Declaration
public static Point BarycentricPercentageFromPoint(Point realPoint, Rect rectangle)
Parameters
realPoint
Point
The real point.
rectangle
Rect
The rectangle which acts as a barycentric coordinate system.
Returns
Point
The percentages wrapped in a Point.
BetweenOrEqual(double, double, double)
Tells you whether the given value sits in the specified interval.
CartesianToPolar(Point, Point, ref double, ref double)
Converts the Cartesian coordinates to polar coordinates.
Closer(Point, Point, Point)
Returns the point of the interval which sits the closest to the given point.
Declaration
public static Point Closer(Point point, Point point1, Point point2)
Parameters
point
Point
The point seeking the closes neighbor.
point1
Point
The first point in the interval.
point2
Point
The second point in the interval.
Returns
Point
Closer(double, double, double)
Given an interval and a value this will output the value which is closer to the given value.
Closer(double, double, double, out double, out double)
Given an interval and a value this will output the value which is closer to the given value.
Declaration
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
public static void Closer(double value, double choice1, double choice2, out double nearestValue, out double otherValue)
Parameters
value
The value.
choice1
The first choice.
choice2
The second choice.
nearestValue
The nearest value.
otherValue
The other value.
CoerceAngle(double)
Coerces the given angle. The return angle will be between 0 and 360.
Constrain(double, double, double)
Constrains the specified value to the given interval.
Delta(Point, Point)
Returns the vector between the two points.
Declaration
public static Vector Delta(this Point point1, Point point2)
Parameters
point1
Point
The point where the vector starts.
point2
Point
The points where the vector ends.
Returns
Vector
Determinant(Point, Point)
Determinants the specified point1.
Declaration
public static double Determinant(Point point1, Point point2)
Parameters
point1
Point
The point1.
point2
Point
The point2.
Returns
Distance(double, double)
Returns the distance of the point to the origin.
DistancePoint(Point, Point, Point)
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.
Declaration
public static Point DistancePoint(Point point, Point lineStart, Point lineEnd)
Parameters
point
Point
The point outside the segment.
lineStart
Point
The first point defining the segment.
lineEnd
Point
The second point defining the segment.
Returns
Point
DistanceSquared(Point, Point)
Returns the squared distance between the given points.
Declaration
public static double DistanceSquared(Point point1, Point point2)
Parameters
point1
Point
point2
Point
Returns
Dot(Point, Point)
Returns the dot product of the specified points.
Declaration
public static double Dot(Point point1, Point point2)
Parameters
point1
Point
point2
Point
Returns
Dot(Vector, Vector)
Returns the dot product of the specified vectors.
Declaration
public static double Dot(Vector vector1, Vector vector2)
Parameters
vector1
Vector
vector2
Vector
Returns
DoubleFromMantissaAndExponent(double, int)
Gets a double value from mantissa and exponent.
EnsureRange(double, double?, double?)
Ensures the range.
FindAngle(Point, Point)
Finds the angle between two points.
Declaration
public static double FindAngle(Point start, Point end)
Parameters
start
Point
end
Point
Returns
FindAngle(Point, Point, Point)
Finds the angle between three points.
Declaration
public static double FindAngle(Point firstPoint, Point centralPoint, Point secondPoint)
Parameters
firstPoint
Point
centralPoint
Point
secondPoint
Point
Returns
FindIntersectionPoint(Rect, double, Point, Point, GlidingStyle)
Finds the intersection point of a shape and the line segment defined by the point
segmentStart and segmentEnd.
Declaration
public static Point FindIntersectionPoint(this Rect rec, double angle, Point segmentStart, Point segmentEnd, GlidingStyle style)
Parameters
rec
Rect
The bounding rectangle of the shape.
angle
The rotation angle.
segmentStart
Point
The line point which is supposedly inside the shape defined by rec.
segmentEnd
Point
The other line point which supposedly sits outside the bounds define by rec.
style
The gliding style.
Returns
Point
FindLinesIntersection(Point, Point, Point, Point, bool)
Finds the intersection point of the lines defined by the point pairs.
Declaration
public static Point FindLinesIntersection(Point line1Start, Point line1End, Point line2Start, Point line2End, bool acceptNaN = false)
Parameters
line1Start
Point
line1End
Point
line2Start
Point
line2End
Point
acceptNaN
Returns
Point
The intersection point. If acceptNaN is
FindRadian(Point, Point)
Finds the radian between two points.
Declaration
public static double FindRadian(Point start, Point end)
Parameters
start
Point
end
Point
Returns
FindRadian(Point, Point, Point)
Finds the radian between three points.
Declaration
public static double FindRadian(Point firstPoint, Point centralPoint, Point secondPoint)
Parameters
firstPoint
Point
centralPoint
Point
secondPoint
Point
Returns
GetAssemblyName(Assembly)
Gets the name of the assembly.
GetBezierPoint(Collection<Point>, int, double)
Gets the Bezier point at the specified value.
Declaration
public static Point GetBezierPoint(Collection<Point> points, int segment, double value)
Parameters
points
Collection<Point>
The points.
segment
The segment.
value
A value in the interval [0,1].
Returns
Point
GetBottomRightPoint(IEnumerable<Point>)
Gets a point from the maximum X and Y values from the specified points.
Declaration
public static Point GetBottomRightPoint(IEnumerable<Point> points)
Parameters
points
IEnumerable<Point>
The points.
Returns
Point
GetBounds(IList<Point>)
Gets the enclosing bounds of the points collection.
Declaration
public static Rect GetBounds(this IList<Point> points)
Parameters
points
IList<Point>
The points collection.
Returns
Rect
GetChildElements(XElement)
Gets the only the child elements.
Declaration
public static IEnumerable<XElement> GetChildElements(this XElement element)
Parameters
element
XElement
The parent element.
Returns
IEnumerable<XElement>
GetEllipsePointAtAngle(Rect, double)
Returns the point at an angle on the ellipse defined by the specified rectangle.
Declaration
public static Point GetEllipsePointAtAngle(this Rect rect, double angle)
Parameters
rect
Rect
The rect.
angle
The angle in degrees.
Returns
Point
GetEnumValues<T>()
Gets the enumeration values.
Declaration
public static T[] GetEnumValues<T>()
Returns
T[]
GetNormalizationPoint(IEnumerable<Point>)
Gets the normalization point.
Declaration
public static Point GetNormalizationPoint(this IEnumerable<Point> points)
Parameters
points
IEnumerable<Point>
The points.
Returns
Point
GetNormalizedPoints(IEnumerable<Point>)
Gets the normalized points.
Declaration
public static IEnumerable<Point> GetNormalizedPoints(this IEnumerable<Point> points)
Parameters
points
IEnumerable<Point>
The points.
Returns
IEnumerable<Point>
GetProjections(Point, Rect, Point[])
Gets the projected points of the specified point on the given rectangle.
Declaration
public static void GetProjections(Point point, Rect rectangle, Point[] projections)
Parameters
point
Point
rectangle
Rect
projections
Point[]
GetPythagorEqualSide(double)
Gets the equal sides of a triangle from the Pythagor theorem.
GetPythagorHypotenuse(double, double)
Gets the hypotenuse according to the Pythagoras theorem.
GetTopLeftPoint(IEnumerable<Point>)
Gets a point from the minimum X and Y values from the specified points.
Declaration
public static Point GetTopLeftPoint(IEnumerable<Point> points)
Parameters
points
IEnumerable<Point>
The points.
Returns
Point
HasValidArea(Size)
Determines whether [has valid area] [the specified size].
Declaration
public static bool HasValidArea(this Size size)
Parameters
size
Size
The size.
Returns
true if [has valid area] [the specified size]; otherwise, false.
Hypotenuse(double, double)
Hypotenuses the specified x.
Intersect(Point[])
Determines whether the specified line segments intersect.
Declaration
public static bool Intersect(Point[] points)
Parameters
points
Point[]
Returns
True if the segments intersect, false if not.
IntersectionPointOnEllipse(Collection<Point>, Point, Point, ref Point)
Calculate the intersection point between a polyline and a line segment.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static bool IntersectionPointOnEllipse(Collection<Point> points, Point org, Point end, ref Point result)
Parameters
points
Collection<Point>
org
Point
end
Point
result
Point
Returns
IntersectionPointOnEllipse(Rect, Point, Point, ref Point)
Calculate the intersection point between an ellipse and a line segment.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static void IntersectionPointOnEllipse(Rect rect, Point lineStart, Point lineEnd, ref Point result)
Parameters
rect
Rect
lineStart
Point
lineEnd
Point
result
Point
IntersectionPointOnRectangle(Rect, Point, Point, ref Point)
Calculates the intersection point between the specified rectangle and the line segment defined by the specified points.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
public static void IntersectionPointOnRectangle(Rect rectangle, Point lineStart, Point lineEnd, ref Point intersectionPoint)
Parameters
rectangle
Rect
lineStart
Point
lineEnd
Point
intersectionPoint
Point
InvertPoint(Point)
Inverts the point.
Declaration
public static Point InvertPoint(this Point point)
Parameters
point
Point
The point.
Returns
Point
IsCounterClockWise(Point, Point, Point)
Determines, given three points, if when travelling from the first to the second to the third, we travel in a counterclockwise direction.
Declaration
public static int IsCounterClockWise(Point point1, Point point2, Point point3)
Parameters
point1
Point
point2
Point
point3
Point
Returns
Remarks
1 if the movement is in a counterclockwise direction, -1 if not.
IsEqual(double, double)
Determines whether the specified values are equal with Epsilon approximation.
IsFiniteDouble(double)
Determines whether [is finite double] [the specified x].
IsGreaterThan(double, double)
Determines whether [is greater than] [the specified value1].
IsGreaterThanOrClose(double, double)
Determines whether [is greater than or close] [the specified value1].
IsInClosedInterval(double, double, double)
Determines whether the specified value is in the specified closed interval.
IsInRightOpenInterval(double, double, double)
Determines whether the specified value is in the specified right open interval.
IsLessOrEqual(double, double)
Determines whether [is less or equal] [the specified value1].
IsLessThan(double, double)
Determines whether [is less than] [the specified value1].
IsLessThanOrClose(double, double)
Determines whether [is less than or close] [the specified value1].
IsNanOrInfinity(Point)
Gets whether the value is NaN or infinite point.
Declaration
public static bool IsNanOrInfinity(this Point value)
Parameters
value
Point
Returns
IsNanOrInfinity(double)
Gets whether the value is double or infinity.
IsNotEqual(double, double)
Determines whether the specified values are not equal with Epsilon approximation.
IsPointInEllipse(Point, Rect)
Returns whether the specified point is inside the ellipse defined by the specified rectangle.
Declaration
public static bool IsPointInEllipse(Point point, Rect rectangle)
Parameters
point
Point
rectangle
Rect
Returns
IsPointInRectangle(Point, Size)
Determines whether [is point in rectangle] [the specified point].
Declaration
public static bool IsPointInRectangle(Point point, Size size)
Parameters
point
Point
The point.
size
Size
The size.
Returns
true if [is point in rectangle] [the specified point]; otherwise, false.
IsVerySmall(double)
Determines whether [is very small] [the specified value].
Length(Point)
Returns the length of the given point considered as a vector.
Declaration
public static double Length(this Point point)
Parameters
point
Point
Returns
Lerp(Point, Point, double)
Linear interpolation between the two given points.
Declaration
public static Point Lerp(Point pointA, Point pointB, double alpha)
Parameters
pointA
Point
The value to be returned when alpha is zero.
pointB
Point
The value to be returned when alpha is equal to one.
alpha
The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.
Returns
Point
Lerp(Vector, Vector, double)
Linear interpolation between the two given vectors.
Declaration
public static Vector Lerp(Vector vectorA, Vector vectorB, double alpha)
Parameters
vectorA
Vector
The value to be returned when alpha is zero.
vectorB
Vector
The value to be returned when alpha is equal to one.
alpha
The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.
Returns
Vector
Lerp(double, double, double)
Linear interpolation between the two given values.
Declaration
public static double Lerp(double x, double y, double alpha)
Parameters
x
The value to be returned when alpha is zero.
y
The value to be returned when alpha is equal to one.
alpha
The linear interpolation parameter which usually takes a value in the interval [0,1] but which works outside this range nevertheless.
Returns
Limit(Point, Rect)
Moves the given point into the rectangle by taking the rectangle's intervals as limiting values for the point's coordinates.
Declaration
public static Point Limit(this Point point, Rect rectangle)
Parameters
point
Point
Any point.
rectangle
Rect
A rectangle which acts as limiting container.
Returns
Point
MiddlePoint(Point, Point)
Returns the middle point between the given points.
Declaration
public static Point MiddlePoint(Point point1, Point point2)
Parameters
point1
Point
A point.
point2
Point
Another point.
Returns
Point
Halfway between the two given points.
MirrorHorizontally(Vector)
Returns the mirrored vector with respect to the X-coordinate.
Declaration
public static Vector MirrorHorizontally(this Vector vector)
Parameters
vector
Vector
The vector to mirror.
Returns
Vector
The mirrored vector.
MirrorPoint(Point, Point)
Mirrors the point with respect to the given center.
Declaration
public static Point MirrorPoint(Point point, Point center)
Parameters
point
Point
center
Point
Returns
Point
MirrorPoint(Point, Point, Point)
Returns the opposite of point point with respect to specified line.
Declaration
public static Point MirrorPoint(Point point, Point lineStart, Point lineEnd)
Parameters
point
Point
lineStart
Point
lineEnd
Point
Returns
Point
MirrorVertically(Vector)
Returns the mirrored vector with respect to the Y-coordinate.
Declaration
public static Vector MirrorVertically(this Vector vector)
Parameters
vector
Vector
The vector to mirror.
Returns
Vector
The mirrored vector.
NearestIntersectionPoint(Point, Point, IList<Point>, ref Point)
Calculates the intersection points with each of the given segments and determines the one nearest to the first point.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static bool NearestIntersectionPoint(Point segmentStart, Point segmentEnd, IList<Point> points, ref Point result)
Parameters
segmentStart
Point
segmentEnd
Point
points
IList<Point>
result
Point
Returns
Returns true if a point (non-NaN values) is found, otherwise false.
NearestPoint(Point, IEnumerable<Point>)
Gets the nearest point.
Declaration
public static Point NearestPoint(this Point point, IEnumerable<Point> points)
Parameters
point
Point
The point.
points
IEnumerable<Point>
The points.
Returns
Point
Normal(Point, Point)
Normalize the specified point1.
Declaration
public static Vector Normal(Point point1, Point point2)
Parameters
point1
Point
The point1.
point2
Point
The point2.
Returns
Vector
NormalizeAngle(double)
Normalizes the specified angle into the [0, 2Pi] interval.
Normalized(Vector)
Normalize the specified vector.
Declaration
public static Vector Normalized(this Vector vector)
Parameters
vector
Vector
The vector.
Returns
Vector
Offset(IEnumerable<Point>, Vector)
Offsets the specified points.
Declaration
public static IList<Point> Offset(this IEnumerable<Point> points, Vector offsetVector)
Parameters
points
IEnumerable<Point>
The points.
offsetVector
Vector
The offset vector.
Returns
IList<Point>
Offset(IList<Point>, IList<Point>, Vector)
Offsets the point collection.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames")]
public static void Offset(IList<Point> points, IList<Point> originalPoints, Vector offset)
Parameters
points
IList<Point>
The points.
originalPoints
IList<Point>
The original points.
offset
Vector
The offset.
Perpendicular(Vector)
Returns the perpendicular of the specified vector.
Declaration
public static Vector Perpendicular(this Vector vector)
Parameters
vector
Vector
A vector.
Returns
Vector
PointFromBarycentricPercentage(Point, Rect)
Given a percentage and a rectangle this will return the coordinates corresponding to the percentages given.
Declaration
public static Point PointFromBarycentricPercentage(Point percentage, Rect rectangle)
Parameters
percentage
Point
A couple of values in percentage, e.g. a value of (50,50) will return the center of the rectangle.
rectangle
Rect
The rectangle which acts as the barycentric system.
Returns
Point
The point corresponding to the barycentric coordinates.
PointFromBarycentricPercentage(Point, Size)
Given rect1 percentage and a rectangle this will return the coordinates corresponding to the percentages given.
Declaration
public static Point PointFromBarycentricPercentage(Point percentage, Size size)
Parameters
percentage
Point
A couple of values in percentage, e.g. a value of (50,50) will return the center of the rectangle.
size
Size
The size from which the point will be extracted.
Returns
Point
The point corresponding to the barycentric coordinates.
PointOnLine(Point, Point, double)
Gets a point extending the line by a specified distance.
Declaration
public static Point PointOnLine(Point startPoint, Point endPoint, double distance)
Parameters
startPoint
Point
The start point.
endPoint
Point
The end point.
distance
The distance.
Returns
Point
PolarToCartesian(Point, double, double)
Polar to cartesian coordinates conversion.
PolylineToBezier(Collection<Point>)
The opposite of the approximation method, this attempts to smoothen out the polyline to a Bezier curve.
Declaration
public static IEnumerable<Point> PolylineToBezier(Collection<Point> points)
Parameters
points
Collection<Point>
The polyline.
Returns
IEnumerable<Point>
ProjectPointOnLine(Point, Point, Point)
Finds the projection (point) of the given point on the line.
Declaration
public static Point ProjectPointOnLine(Point point, Point lineStart, Point lineEnd)
Parameters
point
Point
lineStart
Point
lineEnd
Point
Returns
Point
Push(Point, Vector, double)
Pushes the specified start point onwards in the direction specified by the vector and a length given.
Declaration
public static Point Push(Point start, Vector unitVector, double distance)
Parameters
start
Point
The start.
unitVector
Vector
The unit vector.
distance
The distance to push.
Returns
Point
RotatePointsAt(IList<Point>, Point, double)
Rotates the points.
RotateTransform(Point, double)
Rotates the transform.
Declaration
public static RotateTransform RotateTransform(Point center, double angle)
Parameters
center
Point
The center.
angle
The angle.
Returns
RotateTransform
SafeDivide(double, double, double)
Safes the divide.
SameSide(Point, Point, Point, Point)
Determine whether point1 and point2 are on the same side of a line.
Declaration
public static bool SameSide(Point lineStart, Point lineEnd, Point point1, Point point2)
Parameters
lineStart
Point
lineEnd
Point
point1
Point
point2
Point
Returns
SegmentIntersect(Point, Point, Point, Point, ref Point)
Checks whether the segments defined by the specified point pairs intersect and returns the intersection point.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static bool SegmentIntersect(Point segmentStart, Point segmentEnd, Point lineStart, Point lineEnd, ref Point result)
Parameters
segmentStart
Point
segmentEnd
Point
lineStart
Point
lineEnd
Point
result
Point
Returns
Snap(double, int)
Snaps the specified value.
Square(double)
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.
Declaration
public static Vector StairValue(Point point, Rect rectangle)
Parameters
point
Point
The point to test.
rectangle
Rect
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.
StairValue(double, double, double)
Returns zero within the given interval and +/-1 whether the value is above or below the interval.
Declaration
public static int StairValue(double value, double lower, double upper)
Parameters
value
The argument of the function.
lower
The lower value of the interval.
upper
The upper value of the interval.
Returns
Zero, -1 or +1 whether the value is below, inside, or above the interval.
Swap(ref Point, ref Point)
Swaps the values of the two points.
Declaration
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public static void Swap(ref Point point1, ref Point point2)
Parameters
point1
Point
A point.
point2
Point
Another point.
Swap(ref double, ref double)
Swaps the values of the two numbers.
ToDegrees(double)
Converts the specified value from radians to degrees.
ToDoubleCollection(string)
DoubleCollection from a string representation.
Declaration
public static DoubleCollection ToDoubleCollection(string value)
Parameters
value
Returns
DoubleCollection
ToEnum<T>(object)
Returns value of the enumeration.
Declaration
public static T ToEnum<T>(object value)
Parameters
value
The value.
Returns
T
ToInvariant(DoubleCollection)
Converts the double collection to a string representation.
Declaration
public static string ToInvariant(this DoubleCollection collection)
Parameters
collection
DoubleCollection
The collection.
Returns
ToInvariant(IList<Point>)
Returns a string serialization of the given point collection.
ToInvariant(Point)
Converts the point to a string representation.
Declaration
public static string ToInvariant(this Point point)
Parameters
point
Point
The point.
Returns
ToInvariant(Size)
Converts the point to a string representation.
Declaration
public static string ToInvariant(this Size size)
Parameters
size
Size
The size.
Returns
ToInvariant(double)
Converts the double to a string representation.
ToInvariant(int)
Converts the integer to a string representation.
ToPoint(string)
Attempts to convert the given string to a points.
Declaration
public static Point? ToPoint(string point)
Parameters
point
The string representation of the point.
Returns
Point?
The Point corresponding to the serialized form.
ToPoints(string)
Attempts to convert the given string to a list of points.
ToRadians(double)
Converts the specified value from degrees to radians.
ToRect(Size)
Return a rectangle located a (0.0) with the specified size.
Declaration
public static Rect ToRect(this Size size)
Parameters
size
Size
The s.
Returns
Rect
A rectangle located at the (0.0).
ToSize(string)
Sizes from string.
Declaration
public static Size? ToSize(string size)
Parameters
size
Returns
Size?
ToUnit(Point)
Returns a unit point in the direction defined by the given point.
Declaration
public static Point ToUnit(this Point point)
Parameters
point
Point
Returns
Point
Union(Rect, Rect)
Unions two rectangles.
Declaration
public static Rect Union(Rect rect1, Rect rect2)
Parameters
rect1
Rect
The first rectangle.
rect2
Rect
The second rectangle.
Returns
Rect
Union of the two rectangles.
UnitVector(double)
Returns a unit vector in the direction specified by the angle.
Declaration
public static Vector UnitVector(double degrees)
Parameters
degrees
The angle in degrees.
Returns
Vector
A unit vector.
UppercaseFirstLetter(string)
Uppercases the first letter of the string.