axiolid_linear/line.rs
1//! Unbounded parametric lines.
2
3use axiolid_core::{Point2, Point3, Vec2, Vec3};
4
5/// Infinite parametric line `origin + t * direction`.
6///
7/// The direction is deliberately not normalised on construction: import
8/// adapters preserve authored vectors, and normalising here would silently
9/// change the parameterisation a caller reasons about.
10#[derive(Debug, Clone, Copy, PartialEq)]
11pub struct Line<P, V> {
12 /// Point at parameter zero.
13 pub origin: P,
14 /// Parameter direction; import adapters may preserve a non-unit vector.
15 pub direction: V,
16}
17
18/// Two-dimensional line.
19pub type Line2 = Line<Point2, Vec2>;
20/// Three-dimensional line.
21pub type Line3 = Line<Point3, Vec3>;