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
xThe x-coordinate of the point.
yThe y-coordinate of the point.
-
Creates a point with coordinates specified as integer values.
Declaration
Swift
@inlinable public init(x: Int, y: Int)Parameters
xThe x-coordinate of the point.
yThe y-coordinate of the point.
-
Translates the
lhspoint by the specifiedrhsvector.Declaration
Swift
@inlinable public static func + (lhs: Point, rhs: Vector) -> PointParameters
lhsThe point to translate.
rhsThe difference vector.
Return Value
The point created by translation the
lhspoint by therhsvector. -
Translates the
lhspoint by negation of the specifiedrhsvector.Declaration
Swift
@inlinable public static func - (lhs: Point, rhs: Vector) -> PointParameters
lhsThe point to translate.
rhsThe difference vector.
Return Value
The point created by translation the
lhspoint by negation of therhsvector. -
Returns the vector that needs to be added to
rhsto getlhs.Declaration
Swift
@inlinable public static func - (lhs: Point, rhs: Point) -> VectorParameters
lhsThe first point.
rhsThe second point.
Return Value
The vector that needs to be added to
rhsto getlhs. -
Returns the point resulting from an affine transformation of an existing point.
Declaration
Swift
@inlinable public func applying(_ transform: AffineTransform) -> PointParameters
transformThe 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 }
View on GitHub
Point Structure Reference