robo::math

Trait Cartesian

Source
pub trait Cartesian<T> {
    // Required methods
    fn x(&self) -> T;
    fn y(&self) -> T;
}
Expand description

直行座標系

Required Methods§

Source

fn x(&self) -> T

X座標を返す。

§Examples
use num::Complex;
use robo::math::Cartesian;

let c: Complex<i32> = Complex::new(10, 5);
assert_eq!(c.x(), 10);
Source

fn y(&self) -> T

Y座標を返す。

§Examples
use num::Complex;
use robo::math::Cartesian;

let c: Complex<i32> = Complex::new(10, 5);
assert_eq!(c.y(), 5);

Implementations on Foreign Types§

Source§

impl<T> Cartesian<T> for Complex<T>
where T: Copy,

Source§

fn x(&self) -> T

Source§

fn y(&self) -> T

Implementors§