Vector2Real

public protocol Vector2Real : Vector2FloatingPoint, VectorReal where Self.SubVector3 : Vector3Real

Protocol for 2D real vector types.

  • Returns the angle in radians of the line formed by tracing from the origin (0, 0) to this Vector2Type.

    Declaration

    Swift

    var angle: Scalar { get }
  • angle(to:) Default implementation

    Returns the angle between self and other.

    Default Implementation

    Declaration

    Swift

    func angle(to other: Self) -> Angle<Scalar>
  • rotated(by:) Default implementation

    Returns a rotated version of this vector, rotated around the origin by a given angle in radians

    Default Implementation

    Declaration

    Swift

    @available(*, deprecated, message: "Use rotated(by angle: Angle<Scalar>﹚ instead.")
    func rotated(by angleInRadians: Scalar) -> Self
  • Returns a rotated version of this vector, rotated around the origin by a given angle

    Declaration

    Swift

    func rotated(by angle: Angle<Scalar>) -> Self
  • rotate(by:) Default implementation

    Rotates this vector around the origin by a given angle in radians

    Default Implementation

    Declaration

    Swift

    @available(*, deprecated, message: "Use rotate(by angle: Angle<Scalar>﹚ instead.")
    mutating func rotate(by angleInRadians: Scalar)
  • Rotates this vector around the origin by a given angle

    Declaration

    Swift

    mutating func rotate(by angle: Angle<Scalar>)
  • rotated(by:around:) Default implementation

    Rotates this vector around a given pivot by a given angle in radians

    Default Implementation

    Declaration

    Swift

    @available(*, deprecated, message: "Use rotated(by angle: Angle<Scalar>, around pivot: Self﹚ instead.")
    func rotated(by angleInRadians: Scalar, around pivot: Self) -> Self
  • Rotates this vector around a given pivot by a given angle

    Declaration

    Swift

    func rotated(by angle: Angle<Scalar>, around pivot: Self) -> Self
  • rotate(_:by:) Default implementation

    Rotates a given vector around the origin by an angle in radians

    Default Implementation

    Declaration

    Swift

    @available(*, deprecated, message: "Use rotate(_ vec: Self, by angle: Angle<Scalar>﹚ instead.")
    static func rotate(_ vec: Self, by angleInRadians: Scalar) -> Self
  • Rotates a given vector around the origin by an angle

    Declaration

    Swift

    static func rotate(_ vec: Self, by angle: Angle<Scalar>) -> Self
  • Declaration

    Swift

    @inlinable
    static func * (lhs: Self, rhs: Matrix3x2<Scalar>) -> Self
  • Declaration

    Swift

    @inlinable
    static func *= (lhs: inout Self, rhs: Matrix3x2<Scalar>)