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
Provided Methods
fn pos(&self) -> (f64, f64)
Returns the Position as x,y tuple
fn dot(&self, other: &Is2D) -> f64
Calculates the dot product with another Is2D
fn cross(&self, other: &Is2D) -> f64
Calculates the cross product with another Is2D
fn abs(&self) -> NonNegative
The absolute / length of this position
fn rad_to(&self, other: &Is2D) -> Rad
Calculates the angle to the other Is2D in radians
fn to_str(&self) -> String
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]
P: Is2D,
fn sqr_distance(&self, other: &P) -> NonNegative
[src]
Should return the sqr distance to other
fn distance(&self, other: &T) -> NonNegative
[src]
The distance to other
impl HasDistanceTo<BoundingBox2D> for Is2D
[src]
fn sqr_distance(&self, other: &BoundingBox2D) -> NonNegative
[src]
Should return the sqr distance to other
fn distance(&self, other: &T) -> NonNegative
[src]
The distance to other
Implementations on Foreign Types
impl<P> Is2D for Box<P> where
P: IsND + Is2D,
[src]
P: IsND + Is2D,
Implementors
impl Is2D for FilterBox2D
impl Is2D for FilterCircle
impl Is2D for Point2D
impl Is2D for Norm2D
impl Is2D for Circle
impl Is2D for Box2D