Vector2

public struct Vector2

Two-dimensional Vector.

Instance Properties

  • Length of a Vector2

    Declaration

    Swift

    public var length: Double { get }
  • x

    X value.

    Declaration

    Swift

    public let x: Double
  • y

    Y value.

    Declaration

    Swift

    public let y: Double

Initializers

  • Creates a Vector2 with the given x and y values.

    Declaration

    Swift

    public init(x: Double, y: Double)
  • Creates a Vector2 with two Point values.

    Declaration

    Swift

    public init(_ a: Point, _ b: Point)