diff --git a/crates/fj-math/src/line_segment.rs b/crates/fj-math/src/line_segment.rs index 8cf723375..09d41d77d 100644 --- a/crates/fj-math/src/line_segment.rs +++ b/crates/fj-math/src/line_segment.rs @@ -1,6 +1,6 @@ use std::fmt; -use crate::Scalar; +use crate::{Line, Scalar}; use super::Point; @@ -30,6 +30,16 @@ impl LineSegment { self.points.reverse(); self } + + /// # Convert this `LineSegment` into a [`Line`] + /// + /// This provides access to various utility methods. + pub fn to_line(&self) -> Line { + let [a, b] = self.points; + let [a_line, b_line] = self.points_line; + + Line::from_points_with_line_coords([(a_line, a), (b_line, b)]) + } } impl LineSegment<2> {