pub trait Cartesian<T> { // Required methods fn x(&self) -> T; fn y(&self) -> T; }
直行座標系
X座標を返す。
use num::Complex; use robo::math::Cartesian; let c: Complex<i32> = Complex::new(10, 5); assert_eq!(c.x(), 10);
Y座標を返す。
use num::Complex; use robo::math::Cartesian; let c: Complex<i32> = Complex::new(10, 5); assert_eq!(c.y(), 5);