equal
deleted
inserted
replaced
340 } |
340 } |
341 } |
341 } |
342 |
342 |
343 #[inline] |
343 #[inline] |
344 pub fn max_norm(&self) -> FPNum { |
344 pub fn max_norm(&self) -> FPNum { |
345 std::cmp::max(self.x(), self.y()) |
345 std::cmp::max(self.x().abs(), self.y().abs()) |
346 } |
346 } |
347 |
347 |
348 #[inline] |
348 #[inline] |
349 pub fn sqr_distance(&self) -> FPNum { |
349 pub fn sqr_distance(&self) -> FPNum { |
350 self.x().sqr() + self.y().sqr() |
350 self.x().sqr() + self.y().sqr() |
572 assert_eq!(p * z, z); |
572 assert_eq!(p * z, z); |
573 assert_eq!(p.dot(&z), fp!(0)); |
573 assert_eq!(p.dot(&z), fp!(0)); |
574 assert_eq!(n * p, p * n); |
574 assert_eq!(n * p, p * n); |
575 assert_eq!(distance(4, 3), fp!(5)); |
575 assert_eq!(distance(4, 3), fp!(5)); |
576 assert_eq!(p * fp!(-3), FPPoint::new(fp!(-3), fp!(6))); |
576 assert_eq!(p * fp!(-3), FPPoint::new(fp!(-3), fp!(6))); |
577 } |
577 assert_eq!(p.max_norm(), fp!(2)); |
|
578 } |