pub struct Vec2D<T: Unit> {
    pub x: T,
    pub y: T,
}
Expand description

A 2D (unitless) vector

Fields

x: Ty: T

Implementations

Returns the area of the parallelogram defined by the two vectors.

The area is signed

Trait Implementations

The resulting type after applying the + operator.

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

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

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 number type used by this point type.

The number of dimensions of this point type.

Creates a new point value with given values for each dimension. Read more

Returns a single coordinate of this point. Read more

Mutable variant of nth.

The resulting type after applying the - operator.

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

Performs the conversion.

Performs the conversion.

Returns the squared euclidean distance between an object to a point.

Returns true if a point is contained within this object. Read more

Returns the squared distance to this object, or None if the distance is larger than a given maximum value. Read more

The object’s envelope type. Usually, AABB will be the right choice. This type also defines the object’s dimensionality. Read more

Returns the object’s envelope. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. 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.