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
-
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
-
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)
-
Declaration
Swift
public func offsetBy(_ vector: Vector) -> Line<Vector>
-
Declaration
Swift
public func withPointsScaledBy(_ factor: Vector) -> Line<Vector>
-
Declaration
Swift
public func withPointsScaledBy(_ factor: Vector, around center: Vector) -> Line<Vector>
-
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 asscalar
being returned for all inputs.