Point
public struct Point
extension Point: Additive
extension Point: Equatable
extension Point: Hashable
extension Point: CustomStringConvertible
Representation of a point.
-
Horizontal position.
Declaration
Swift
public let x: Double
-
Vertical position.
Declaration
Swift
public let y: Double
-
Declaration
Swift
public func distance(to other: Point) -> Double
Return Value
The distance to the given
other
point. -
Declaration
Swift
public func translated(by point: Point) -> Point
Return Value
Point
translated by the givenpoint
. -
Declaration
Swift
public func scaled(by amount: Double, from reference: Point = Point()) -> Point
Return Value
Point
scaled by the givenamount
from the givenreference
point. -
Declaration
Swift
public func rotated(by angle: Angle, around reference: Point = Point()) -> Point
Return Value
Point
rotated by the givenangle
around the givenreference
point. -
Declaration
Swift
public func reflected(over line: Line) -> Point
Return Value
Point
reflected over the givenline
.
-
Additive identity.
Declaration
Swift
public static var zero: Point { get }
-
Declaration
Swift
public subscript(axis: Axis) -> Double { get }
Return Value
The value contained herein for the given
axis
. -
Declaration
Swift
public static func + (lhs: Point, rhs: Point) -> Point
Return Value
Point
value containing sums of their respective x- and y-values. -
Declaration
Swift
public static func - (lhs: Point, rhs: Point) -> Point
Return Value
Point
value containing differences of their respective x- and y-values.
-
Printed description.
Declaration
Swift
public var description: String { get }
-
Undocumented
Declaration
Swift
public typealias Triple = (Point, Point, Point)