summaryrefslogtreecommitdiff
path: root/src/algebra/line.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/line.rs')
-rw-r--r--src/algebra/line.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/algebra/line.rs b/src/algebra/line.rs
deleted file mode 100644
index 45733b9..0000000
--- a/src/algebra/line.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use crate::{particle_system::Scalar, Point, Vector};
-
-pub struct Line {
- pub point: Point,
-
- /// Has to be normalized
- pub vector: Vector,
-}
-
-impl Line {
- pub fn new(point: Point, vector: Vector) -> Self {
- Self {
- point,
- vector: vector.normalize(),
- }
- }
-
- pub fn distance_to_point(&self, point: Point) -> Scalar {
- let diff = point - self.point;
- let lambda = diff.dot(&self.vector);
-
- (diff - lambda * self.vector).norm()
- }
-}