Line

public struct Line<Vector> : LineType where Vector : VectorType
extension Line: Equatable where Vector: Equatable, Scalar: Equatable
extension Line: Hashable where Vector: Hashable, Scalar: Hashable
extension Line: Encodable where Vector: Encodable, Scalar: Encodable
extension Line: Decodable where Vector: Decodable, Scalar: Decodable
extension Line: LineAdditive where Vector: VectorAdditive
extension Line: LineMultiplicative where Vector: VectorMultiplicative
extension Line: LineDivisible where Vector: VectorDivisible
extension Line: LineSigned where Vector: VectorSigned
extension Line: LineFloatingPoint & PointProjectableType & SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension Line: LineReal where Vector: VectorReal

Represents a geometric line as a pair of start and end N-dimensional vectors which describe the two points an infinite line crosses.

  • Declaration

    Swift

    public typealias Scalar = Vector.Scalar
  • a

    An initial point a line tracing from infinity passes through before being projected through b and extending to infinity in a straight line.

    Declaration

    Swift

    public var a: Vector
  • b

    A secondary point a line tracing from a passes through before being projected to infinity in a straight line.

    Declaration

    Swift

    public var b: Vector
  • Declaration

    Swift

    @inlinable
    public var category: LineCategory { get }
  • Declaration

    Swift

    public init(a: Vector, b: Vector)

Available where Vector: VectorAdditive

  • Declaration

    Swift

    public func offsetBy(_ vector: Vector) -> Line<Vector>

Available where Vector: VectorMultiplicative

Available where Vector: VectorFloatingPoint

  • Returns true for all non-NaN scalar values, which describes a geometric line.

    This makes the line behave effectively like an infinitely long line when working with methods from LineFloatingPoint conformance.

    Declaration

    Swift

    public func containsProjectedNormalizedMagnitude(
        _ scalar: Vector.Scalar
    ) -> Bool
  • Returns a projected normalized magnitude that is guaranteed to be contained in this line.

    For Line, this is the full range of representable scalars, -∞ to ∞, resulting in the same value as scalar being returned for all inputs.

    Declaration

    Swift

    public func clampProjectedNormalizedMagnitude(
        _ scalar: Vector.Scalar
    ) -> Vector.Scalar