Struct ludomath::vec2d::Point [] [src]

#[repr(C)]
pub struct Point { pub x: f32, pub y: f32, }

Represents a cartesian point in the 2D euclidean plane.

Fields

The X coordinate of the point.

The Y coordinate of the point.

Methods

impl Point
[src]

[src]

Constructs a new point from x- and y-components.

[src]

Constructs a new point from polar coordinates.

The angle is given in radians.

[src]

Constructs a new point from polar coordinates.

The angle is given in degrees.

[src]

Computes the euclidean distance between two points.

[src]

Rotates a point around a pivot point.

[src]

Rotates a point angle radians counter-clockwise around a pivot point.

[src]

Rotates a point angle degrees counter-clockwise around a pivot point.

[src]

Linearly interpolates from one point to another by t.

t < 0 or t > 1 gives results outside the rectangular bounds of the points.

[src]

Returns true if self is within the (inclusive) bounds of the rectangle defined by two points.

[src]

Clamps a vector to within the (inclusive) bounds of the rectangle defined by two points.

[src]

Reinterprets the x- and y-components of a point as a vector.

[src]

Changes the type of a OpenGL-style vec2 array to a Point.

Optimizes into a simple copy, since the types have the same layout. Useful mostly for interop with other libraries, like OpenGL wrappers.

[src]

Changes the type of a Point to a OpenGL-style vec2 array.

Optimizes into a simple copy, since the types have the same layout. Useful mostly for interop with other libraries, like OpenGL wrappers.

[src]

Converts a OpenGL-style vec2 to a Point.

Optimizes into a simple copy, since the types have the same layout.

[src]

Converts a Point to a OpenGL-style vec2.

Optimizes into a simple copy, since the types have the same layout.

[src]

Converts a Point to a OpenGL-style vec3.

The result is padded to [x, y, 0].

[src]

Converts a Point to a OpenGL-style vec4.

The result is padded to [x, y, 0, 1].

[src]

Reinterprets a slice of vec2s as Points.

Does not allocate a new array, only changes the type of the pointer.

[src]

Reinterprets a slice of Points as vec2s.

Does not allocate a new array, only changes the type of the pointer.

Trait Implementations

impl Clone for Point
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Point
[src]

impl Default for Point
[src]

[src]

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

impl PartialEq for Point
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for Point
[src]

[src]

Formats the value using the given formatter. Read more

impl Transformation<Point> for Transform
[src]

[src]

Returns a transformed copy of an object. Read more

[src]

Transforms an object by the inverse of a transformation. Read more

[src]

Transforms an object, mutating it.

[src]

Transforms an object by the inverse of a transformation. Read more

impl Add<Vector> for Point
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Add<Point> for Vector
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Vector> for Point
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Sub<Point> for Point
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl AddAssign<Vector> for Point
[src]

[src]

Performs the += operation.

impl SubAssign<Vector> for Point
[src]

[src]

Performs the -= operation.

Auto Trait Implementations

impl Send for Point

impl Sync for Point