[][src]Trait rust_3d::Is2D

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

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

Required methods

fn x(&self) -> f64

Should return the x-coordinate

fn y(&self) -> f64

Should return the y-coordinate

Loading content...

Provided methods

fn xy(&self) -> [f64; 2]

Returns the Position as x,y array

fn dot(&self, other: &dyn Is2D) -> f64

Calculates the dot product with another Is2D

fn cross(&self, other: &dyn Is2D) -> f64

Calculates the cross product with another Is2D

fn abs(&self) -> NonNegative

The absolute / length of this position

fn rad_to(&self, other: &dyn 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"

Loading content...

Trait Implementations

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

Implementations on Foreign Types

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

Loading content...

Implementors

impl Is2D for BoundingBox2D[src]

impl Is2D for Box2D[src]

impl Is2D for Circle[src]

impl Is2D for FilterBox2D[src]

impl Is2D for FilterCircle[src]

impl Is2D for Norm2D[src]

impl Is2D for Point2D[src]

Loading content...