Point

public struct Point<N> : Equatable, CustomStringConvertible where N : Numeric

The Point generic captures a single in space.

  • x

    The x coordinate of the point

    Declaration

    Swift

    public var x: N
  • y

    The y coordinate of the point

    Declaration

    Swift

    public var y: N
  • Creates a new instance of a point from the given parameters

    Declaration

    Swift

    public init(x: N, y: N)

    Parameters

    x

    Desired x coordinate

    y

    Desired y coordinate

  • A point with x and y equal to 0

    Declaration

    Swift

    public static var zero: `Self` { get }
  • The description of the point

    Declaration

    Swift

    public var description: String { get }

Available where N : BinaryFloatingPoint

  • Undocumented

    Declaration

    Swift

    func distance(to p2: Point<N>) -> N