src/cylinder.rs

changeset 56
34f8ec636368
parent 46
90cc221eb52b
equal deleted inserted replaced
55:15f01efc034b 56:34f8ec636368
1 /*! 1 /*!
2 Implementation of the surface of a 3D cylinder as a [`ManifoldPoint`]. 2 Implementation of the surface of a 3D cylinder as a [`ManifoldPoint`].
3 */ 3 */
4 4
5 use alg_tools::euclidean::{Euclidean, Dot}; 5 use alg_tools::euclidean::Euclidean;
6 use serde_repr::*; 6 use serde_repr::*;
7 use serde::{Serialize, Deserialize}; 7 use serde::{Serialize, Deserialize};
8 use alg_tools::loc::Loc; 8 use alg_tools::loc::Loc;
9 use alg_tools::norms::{Norm, L2}; 9 use alg_tools::norms::{Norm, L2};
10 use alg_tools::types::Float; 10 use alg_tools::types::Float;
11 use alg_tools::impl_basic_space;
11 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint, FacedManifoldPoint}; 12 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint, FacedManifoldPoint};
12 use crate::newton::{newton_sym1x1, newton_sym2x2}; 13 use crate::newton::{newton_sym1x1, newton_sym2x2};
13 14
14 /// Angle 15 /// Angle
15 pub type Angle = f64; 16 pub type Angle = f64;
906 fn tangent_origin(&self) -> Self::Tangent { 907 fn tangent_origin(&self) -> Self::Tangent {
907 Loc([0.0, 0.0]) 908 Loc([0.0, 0.0])
908 } 909 }
909 } 910 }
910 911
912 impl_basic_space!(OnCylinder<'a> where 'a);
913
911 #[cfg(test)] 914 #[cfg(test)]
912 mod tests { 915 mod tests {
913 use super::*; 916 use super::*;
914 917
915 static TOL : f64 = 1e-7; 918 static TOL : f64 = 1e-7;
1140 check_vec_eq!(tap + tbpside, t); 1143 check_vec_eq!(tap + tbpside, t);
1141 } 1144 }
1142 } 1145 }
1143 } 1146 }
1144 } 1147 }
1148

mercurial