cheap_ruler/
point_on_line.rs1use geo_types::Point;
2use num_traits::cast::NumCast;
3use num_traits::Num;
4use std::fmt;
5
6pub struct PointOnLine<T>
7where
8 T: Num + NumCast + Copy + PartialEq + PartialOrd + fmt::Debug,
9{
10 point: Point<T>,
11 index: usize,
12 t: T,
13}
14
15impl<T> PointOnLine<T>
16where
17 T: Num + NumCast + Copy + PartialEq + PartialOrd + fmt::Debug,
18{
19 pub fn new(point: Point<T>, index: usize, t: T) -> Self {
20 Self { point, index, t }
21 }
22
23 pub fn point(&self) -> Point<T> {
24 self.point
25 }
26
27 pub fn index(&self) -> usize {
28 self.index
29 }
30
31 pub fn t(&self) -> T {
32 self.t
33 }
34}