Gec

Struct Gec 

Source
pub struct Gec<S: Scalar, const DIM: usize>(pub [S; DIM]);

Tuple Fields§

§0: [S; DIM]

Implementations§

Source§

impl<S: Scalar, const DIM: usize> Gec<S, DIM>

Source

pub fn scale(self, by: S) -> Self

Source§

impl<S: Scalar, const DIM: usize> Gec<S, DIM>

Source

pub fn zero() -> Self

Source

pub fn ones() -> Self

Source

pub fn dot(self, other: Self) -> S

Source

pub fn length_squared(self) -> S

Source§

impl<S: ScalarFloat, const DIM: usize> Gec<S, DIM>

Source

pub fn length(self) -> S

Source

pub fn to_unit(self) -> Self

Source§

impl<S: RandFloat, const DIM: usize> Gec<S, DIM>

Source

pub fn random<R: RngCore + ?Sized>(r: &mut R) -> Self

Source

pub fn random_openclosed<R: RngCore + ?Sized>(r: &mut R) -> Self

Source

pub fn random_unit<R: RngCore + ?Sized>(rng: &mut R) -> Self

Source

pub fn random_on_hemisphere<R: RngCore + ?Sized>( rng: &mut R, normal: Self, ) -> Self

unit vector with angle < pi relative to the provided normal direction

Source

pub fn random_in_unit_disk<R: RngCore + ?Sized>(rng: &mut R) -> Self

Source§

impl<S: Scalar> Gec<S, 3>

Source

pub fn cross(self, other: Self) -> Self

Source

pub fn to_homogeneous(&self) -> Gec<S, 4>

Trait Implementations§

Source§

impl<S: Scalar, const DIM: usize> Add<&Gec<S, DIM>> for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Gec<S, DIM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Add<Gec<S, DIM>> for &Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Add for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<S: Scalar + AddAssign, const DIM: usize> AddAssign<&Gec<S, DIM>> for Gec<S, DIM>

Source§

fn add_assign(&mut self, rhs: &Gec<S, DIM>)

Performs the += operation. Read more
Source§

impl<T: Scalar + AddAssign, const DIM: usize> AddAssign for Gec<T, DIM>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<S: Clone + Scalar, const DIM: usize> Clone for Gec<S, DIM>

Source§

fn clone(&self) -> Gec<S, DIM>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug + Scalar, const DIM: usize> Debug for Gec<S, DIM>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Scalar, const DIM: usize> Div<&Gec<S, DIM>> for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Gec<S, DIM>) -> Self::Output

Performs the / operation. Read more
Source§

impl<S: Scalar + DivAssign, const DIM: usize> DivAssign<&Gec<S, DIM>> for Gec<S, DIM>

Source§

fn div_assign(&mut self, rhs: &Gec<S, DIM>)

Performs the /= operation. Read more
Source§

impl<S: Scalar + DivAssign, const DIM: usize> DivAssign for Gec<S, DIM>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<S: Scalar, const DIM: usize> From<[S; DIM]> for Gec<S, DIM>

Source§

fn from(value: [S; DIM]) -> Self

Converts to this type from the input type.
Source§

impl<S: Scalar, const DIM: usize> Index<usize> for Gec<S, DIM>

Source§

type Output = S

The returned type after indexing.
Source§

fn index<'a>(&'a self, i: usize) -> &'a S

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Scalar, const DIM: usize> IndexMut<usize> for Gec<T, DIM>

Source§

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Mul<&Gec<S, DIM>> for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Gec<S, DIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Mul<Gec<S, DIM>> for &Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Scalar, const NROWS: usize, const NCOLS: usize> Mul<Gec<S, NCOLS>> for &Mat<S, NROWS, NCOLS>

Source§

type Output = Gec<S, NROWS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<S, NCOLS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Scalar, const NROWS: usize, const NCOLS: usize> Mul<Gec<S, NCOLS>> for Mat<S, NROWS, NCOLS>

Source§

type Output = Gec<S, NROWS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<S, NCOLS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const DIM: usize> Mul<Gec<f32, DIM>> for f32

Source§

type Output = Gec<f32, DIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<f32, DIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const DIM: usize> Mul<Gec<f64, DIM>> for f64

Source§

type Output = Gec<f64, DIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<f64, DIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Mul for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Scalar + MulAssign, const DIM: usize> MulAssign<&Gec<S, DIM>> for Gec<S, DIM>

Source§

fn mul_assign(&mut self, rhs: &Gec<S, DIM>)

Performs the *= operation. Read more
Source§

impl<T: Scalar + MulAssign, const DIM: usize> MulAssign for Gec<T, DIM>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Neg for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Sub<&Gec<S, DIM>> for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Gec<S, DIM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Sub<Gec<S, DIM>> for &Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: Scalar, const DIM: usize> Sub for Gec<S, DIM>

Source§

type Output = Gec<S, DIM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Gec<S, DIM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: Scalar + SubAssign, const DIM: usize> SubAssign<&Gec<S, DIM>> for Gec<S, DIM>

Source§

fn sub_assign(&mut self, rhs: &Gec<S, DIM>)

Performs the -= operation. Read more
Source§

impl<S: Scalar + SubAssign, const DIM: usize> SubAssign for Gec<S, DIM>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<S: Copy + Scalar, const DIM: usize> Copy for Gec<S, DIM>

Auto Trait Implementations§

§

impl<S, const DIM: usize> Freeze for Gec<S, DIM>
where S: Freeze,

§

impl<S, const DIM: usize> RefUnwindSafe for Gec<S, DIM>
where S: RefUnwindSafe,

§

impl<S, const DIM: usize> Send for Gec<S, DIM>
where S: Send,

§

impl<S, const DIM: usize> Sync for Gec<S, DIM>
where S: Sync,

§

impl<S, const DIM: usize> Unpin for Gec<S, DIM>
where S: Unpin,

§

impl<S, const DIM: usize> UnwindSafe for Gec<S, DIM>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V