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) -> DoubleReturn Value
The distance to the given
otherpoint. -
Declaration
Swift
public func translated(by point: Point) -> PointReturn Value
Pointtranslated by the givenpoint. -
Declaration
Swift
public func scaled(by amount: Double, from reference: Point = Point()) -> PointReturn Value
Pointscaled by the givenamountfrom the givenreferencepoint. -
Declaration
Swift
public func rotated(by angle: Angle, around reference: Point = Point()) -> PointReturn Value
Pointrotated by the givenanglearound the givenreferencepoint. -
Declaration
Swift
public func reflected(over line: Line) -> PointReturn Value
Pointreflected 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) -> PointReturn Value
Pointvalue containing sums of their respective x- and y-values. -
Declaration
Swift
public static func - (lhs: Point, rhs: Point) -> PointReturn Value
Pointvalue 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)
View on GitHub
Install in Dash
Point Structure Reference