DirectionalRay2
extension DirectionalRay2: Line2Type
extension DirectionalRay2: Line2Multiplicative where Vector: Vector2Multiplicative
extension DirectionalRay2: Line2Signed where Vector: Vector2Signed
extension DirectionalRay2: Line2FloatingPoint where Vector: Vector2FloatingPoint
extension DirectionalRay2: Line2Real where Vector: Vector2Real
-
Initializes a new Directional Ray with 2D vectors describing the start and secondary point the ray crosses before projecting towards infinity.
The direction will be normalized before initializing.
Precondition
Vector(x: x2 - x1, y: y2 - y1).length > 0
Declaration
Swift
public init(x1: Scalar, y1: Scalar, x2: Scalar, y2: Scalar)
-
Initializes a new Directional Ray with a 2D vector for its position and another describing the direction of the ray relative to the position.
The direction will be normalized before initializing.
Precondition
Vector(x: dx, y: dy).length > 0
Declaration
Swift
public init(x: Scalar, y: Scalar, dx: Scalar, dy: Scalar)
-
Returns the angle of this directional ray, in radians
Declaration
Swift
public var angle: Vector.Scalar { get }