Struct rust_3d::point_2d::Point2D [] [src]

pub struct Point2D {
    pub x: f64,
    pub y: f64,
}

Point2D, a point / position within 2D space

Fields

Trait Implementations

impl PartialEq for Point2D
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Point2D
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Default for Point2D
[src]

Returns the "default value" for a type. Read more

impl Clone for Point2D
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for Point2D
[src]

impl Ord for Point2D
[src]

This method returns an Ordering between self and other. Read more

impl Hash for Point2D
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Add for Point2D
[src]

The resulting type after applying the + operator

The method for the + operator

impl Mul<f64> for Point2D
[src]

The resulting type after applying the * operator

The method for the * operator

impl IsMovable2D for Point2D
[src]

Should move the object by the given offset

impl IsND for Point2D
[src]

Should return the number of dimensions. E.g. 2 for points in 2D space, 3 for points in 3D space etc.

Should return the value of a given dimensions. E.g. for 2D position with x = 4.3, y = 1.8 the result for dimension = 1 should be 1.8

impl Is2D for Point2D
[src]

Should return the x-coordinate

Should return the y-coordinate

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"

impl IsBuildableND for Point2D
[src]

Should build an object from the correct number of coordinates

Should use the coordinates of another as its own

impl IsBuildable2D for Point2D
[src]

Should build an object from x and y coordinates

Should use the coordinates of another as its own

Returns this with normalized values

Creates this from a "x y" string. E.g. "4.3 17.29"

impl IsEditableND for Point2D
[src]

Should set the coordinate / position at dimension to val

impl IsEditable2D for Point2D
[src]

Should set the position in x

Should set the position in y

Sets the position from a x and y values

Adds the coordinates of other onto this. x = x + other.x ...

Substracts the coordinates of other from this. x = x - other.x ...

Scales the coordinates by applying a factor to all of them

Rotates the position around a center ccw for rad radians

impl IsTransFormableTo3D for Point2D
[src]

Should create representation of self within the 3D space with a given z-coordinate

impl Display for Point2D
[src]

Formats the value using the given formatter. Read more