Geometry
public struct Geometry
Represents a geometry object.
-
Converts the specified angle from degrees to radians.
Declaration
Swift
public static func radians(_ angle: Double) -> DoubleParameters
angleA double value, which specifies the angle in degrees.
Return Value
A double value, which specifies the angle in radians.
-
Converts the specified angle from radians to degrees.
Declaration
Swift
public static func degrees(_ angle: Double) -> DoubleParameters
angleA double value, which specifies the angle in radians.
Return Value
A double value, which specifies the angle in degrees.
-
Converts the cartesian coordinate of the specified point to polar coordinates.
Declaration
-
Converts the polar coordinate of the specifiedpoint to cartesian coordinates.
Declaration
-
Finds the intersection point of two lines.
Declaration
Parameters
m1The first point of the first line segment.
m2The second point of the first segment.
n1The first point of the second line segment.
n2The second point of the second segment.
Return Value
The point where the two lines intersect. It can be with nan-coordinates if the two lines do not intersect.
-
Calulates the square of the shortest distance between a point and another point defined by its coordinates.
Declaration
Swift
public static func distanceSquared(_ p: Point, x: Double, y: Double) -> DoubleParameters
pThe point.
xThe x-coordinate of the second point.
yThe y-coordinate of the second point.
Return Value
The square of the shortest distance between the points.
-
Normalizes the specified rectangle.
Parameters
rectThe rectangle to normalize.
Return Value
The normalized rectangle.
Geometry Structure Reference