src/loc.rs

branch
dev
changeset 131
8264d72aa347
parent 129
d2994e34a5f5
equal deleted inserted replaced
130:0a689881b0f1 131:8264d72aa347
430 430
431 domination!(Linfinity, L1); 431 domination!(Linfinity, L1);
432 domination!(Linfinity, L2); 432 domination!(Linfinity, L2);
433 domination!(L2, L1); 433 domination!(L2, L1);
434 434
435 impl<F: Float, const N: usize> Euclidean<F> for Loc<N, F> { 435 impl<F: Float, const N: usize> Euclidean for Loc<N, F> {
436 type Output = Self;
437
438 /// This implementation is not stabilised as it's meant to be used for very small vectors. 436 /// This implementation is not stabilised as it's meant to be used for very small vectors.
439 /// Use [`nalgebra`] for larger vectors. 437 /// Use [`nalgebra`] for larger vectors.
440 #[inline] 438 #[inline]
441 fn dot<I: Instance<Self>>(&self, other: I) -> F { 439 fn dot<I: Instance<Self>>(&self, other: I) -> F {
442 self.0 440 self.0
563 [x, y, z] = [x, cos_θ * y - sin_θ * z, sin_θ * y + cos_θ * z]; 561 [x, y, z] = [x, cos_θ * y - sin_θ * z, sin_θ * y + cos_θ * z];
564 [x, y, z].into() 562 [x, y, z].into()
565 } 563 }
566 } 564 }
567 565
568 impl<F: Float, const N: usize> StaticEuclidean<F> for Loc<N, F> { 566 impl<F: Float, const N: usize> StaticEuclidean for Loc<N, F> {
569 #[inline] 567 #[inline]
570 fn origin() -> Self { 568 fn origin() -> Self {
571 Self::ORIGIN 569 Self::ORIGIN
572 } 570 }
573 } 571 }

mercurial