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

A point.

Doesn’t guarantee to be finite.

Fields

x: f32y: f32

Implementations

Creates a new Point.

Creates a new Point from f32x2.

Converts a Point into a f32x2.

Creates a point at 0x0 position.

Returns true if x and y are both zero.

Returns true if both x and y are measurable values.

Both values are other than infinities and NaN.

Scales (fX, fY) so that length() returns one, while preserving ratio of fX to fY, if possible.

If prior length is nearly zero, sets vector to (0, 0) and returns false; otherwise returns true.

Sets vector to (x, y) scaled so length() returns one, and so that (x, y) is proportional to (x, y).

If (x, y) length is nearly zero, sets vector to (0, 0) and returns false; otherwise returns true.

Returns the Euclidean distance from origin.

Scales vector so that distanceToOrigin() returns length, if possible.

If former length is nearly zero, sets vector to (0, 0) and return false; otherwise returns true.

Sets vector to (x, y) scaled to length, if possible.

If former length is nearly zero, sets vector to (0, 0) and return false; otherwise returns true.

Returns the Euclidean distance from origin.

Returns the dot product of two points.

Returns the cross product of vector and vec.

Vector and vec form three-dimensional vectors with z-axis value equal to zero. The cross product is a three-dimensional vector with x-axis and y-axis values equal to zero. The cross product z-axis component is returned.

Scales Point in-place by scale.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

This method tests for !=.

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.