Trait rust_3d::traits::Is2D [] [src]

pub trait Is2D: IsND {
    fn x(&self) -> f64;
fn y(&self) -> f64; fn pos(&self) -> (f64, f64) { ... }
fn dot(&self, other: &Is2D) -> f64 { ... }
fn cross(&self, other: &Is2D) -> f64 { ... }
fn abs(&self) -> NonNegative { ... }
fn rad_to(&self, other: &Is2D) -> Rad { ... }
fn to_str(&self) -> String { ... } }

Is2D is a trait used for types which are positioned within the 2D space

Required Methods

Should return the x-coordinate

Should return the y-coordinate

Provided Methods

Returns the Position as x,y tuple

Calculates the dot product with another Is2D

Calculates the cross product with another Is2D

The absolute / length of this position

Calculates the angle to the other Is2D in radians

Transforms the position in a "x y" string. E.g. "3.72 5.99"

Trait Implementations

impl<P> HasDistanceTo<P> for Is2D where
    P: Is2D
[src]

[src]

Should return the sqr distance to other

[src]

The distance to other

impl HasDistanceTo<BoundingBox2D> for Is2D
[src]

[src]

Should return the sqr distance to other

[src]

The distance to other

Implementations on Foreign Types

impl<P> Is2D for Box<P> where
    P: IsND + Is2D
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Implementors