Skip to main content

Vector

Type Alias Vector 

Source
pub type Vector = Vec2;
Expand description

The vector type.

Aliased Type§

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

Fields§

§x: f32§y: f32

Trait Implementations§

Source§

impl ComponentMul for Vector

Source§

fn component_mul(&self, other: &Self) -> Self

Element-wise multiplication
Source§

impl CrossProduct<Vec2> for Vector

Available on crate feature dim2 only.
Source§

type Result = f32

The result type of the cross product.
Source§

fn gcross(&self, rhs: Vector) -> Self::Result

Computes the generalized cross product of self with rhs.
Source§

impl CrossProductMatrix for Vector

Available on crate feature dim2 only.
Source§

type CrossMat = Vec2

The cross product matrix type.
Source§

type CrossMatTr = Vec2

The transposed cross product matrix type.
Source§

fn gcross_matrix(self) -> Self::CrossMat

Returns the cross product matrix of this vector.
Source§

fn gcross_matrix_tr(self) -> Self::CrossMatTr

Returns the transposed cross product matrix of this vector.
Source§

impl DotProduct<Vec2> for Vector

Source§

type Result = f32

The result type of the dot product.
Source§

fn gdot(&self, rhs: Vector) -> Self::Result

Computes the generalized dot product of self with rhs.
Source§

impl OrthonormalBasis for Vector

Available on crate feature dim2 only.
Source§

type Basis = [Vec2; 1]

The type of the array of orthonormal vectors.
Source§

fn orthonormal_basis(self) -> [Vector; 1]

Computes the vectors which, when combined with self, form an orthonormal basis.
Source§

fn orthonormal_vector(self) -> Vector

Computes a vector orthogonal to self with a unit length (if self has a unit length).
Source§

impl SimdSelect<f32> for Vector

Source§

fn select(self, condition: bool, if_false: Self) -> Self

Select between self and if_false based on condition.