Point
public struct Point : Hashable
A structure that contains a point in a two-dimensional coordinate system.
-
The point with location (0, 0).
Declaration
Swift
public static let zero: Point
-
The x-coordinate of the point.
Declaration
Swift
public var x: Float
-
The y-coordinate of the point.
Declaration
Swift
public var y: Float
-
Creates a point with coordinates specified as floating-point values.
Declaration
Swift
@inlinable public init(x: Float, y: Float)
Parameters
x
The x-coordinate of the point.
y
The y-coordinate of the point.
-
Creates a point with coordinates specified as integer values.
Declaration
Swift
@inlinable public init(x: Int, y: Int)
Parameters
x
The x-coordinate of the point.
y
The y-coordinate of the point.
-
Translates the
lhs
point by the specifiedrhs
vector.Declaration
Swift
@inlinable public static func + (lhs: Point, rhs: Vector) -> Point
Parameters
lhs
The point to translate.
rhs
The difference vector.
Return Value
The point created by translation the
lhs
point by therhs
vector. -
Translates the
lhs
point by negation of the specifiedrhs
vector.Declaration
Swift
@inlinable public static func - (lhs: Point, rhs: Vector) -> Point
Parameters
lhs
The point to translate.
rhs
The difference vector.
Return Value
The point created by translation the
lhs
point by negation of therhs
vector. -
Returns the vector that needs to be added to
rhs
to getlhs
.Declaration
Swift
@inlinable public static func - (lhs: Point, rhs: Point) -> Vector
Parameters
lhs
The first point.
rhs
The second point.
Return Value
The vector that needs to be added to
rhs
to getlhs
. -
Returns the point resulting from an affine transformation of an existing point.
Declaration
Swift
@inlinable public func applying(_ transform: AffineTransform) -> Point
Parameters
transform
The affine transform to apply.
Return Value
A new point resulting from applying the specified affine transform to the existing point.
-
Declaration
Swift
public var debugDescription: String { get }