Vector3

Struct Vector3 

Source
pub struct Vector3<V> { /* private fields */ }

Implementations§

Source§

impl<V> Vector3<V>
where V: Debug + Copy + From<f32>,

Source

pub fn create(components: &[V; 3]) -> Self

Source

pub fn get_components(&self) -> [V; 3]

Source

pub fn cross_product(&self, other: &Self) -> Self
where V: Sub<Output = V> + Mul<Output = V>,

Source

pub fn cosine_angle_between_vectors(&self, other: &Self) -> V
where V: FloatTrait<Output = V>,

Source

pub fn projection_perpendicular_to_vector(&self, other: &Self) -> Self
where V: FloatTrait<Output = V>,

Source

pub fn rotation_matrix_to_align_with_vector( &self, other: &Self, rel_tol: V, abs_tol: V, ) -> Result<Matrix<V>, String>
where V: FloatTrait<Output = V>,

Trait Implementations§

Source§

impl<V> BasicOperationsTrait for Vector3<V>

Source§

type Value = V

Source§

fn get_shape(&self) -> &Shape

Source§

fn get_mut_shape(&mut self) -> &mut Shape

Source§

fn get_elements(&self) -> &HashMap<Position, Self::Value>

Source§

fn get_mut_elements(&mut self) -> &mut HashMap<Position, Self::Value>

Source§

fn get_element_value(&self, position: &Position) -> Result<&Self::Value, String>
where Self::Value: Copy,

Source§

fn get_mut_element_value( &mut self, position: &Position, ) -> Result<&mut Self::Value, String>
where Self::Value: Copy,

Source§

fn shape_conformity_check<M>( &self, other: &M, operation: Operation, ) -> Result<(), String>

Source§

fn add<M>(&self, other: &M) -> Result<Self, String>
where M: BasicOperationsTrait<Value = Self::Value>, Self::Value: Copy + AddAssign, Self: Clone,

Source§

fn subtract<M>(&self, other: &M) -> Result<Self, String>
where M: BasicOperationsTrait<Value = Self::Value>, Self::Value: Copy + SubAssign, Self: Clone,

Source§

fn multiply_by_scalar(&self, scalar: Self::Value) -> Self
where Self::Value: Copy + MulAssign, Self: Clone,

Source§

fn multiply<M>(&self, other: &M) -> Result<Matrix<Self::Value>, String>
where M: IntoMatrixTrait<Value = Self::Value> + Clone, Self::Value: Copy + AddAssign + SubAssign + Mul<Output = Self::Value> + From<f32>,

Source§

fn transpose(&self) -> Self
where Self::Value: Copy, Self: Clone,

Source§

fn remove_row(&self, row: usize) -> Result<Matrix<Self::Value>, String>
where Self::Value: Copy,

Source§

fn remove_column(&self, column: usize) -> Result<Matrix<Self::Value>, String>
where Self::Value: Copy,

Source§

fn show<F>(&self, f: F)
where F: Fn(&str), Self::Value: Copy + Debug,

Source§

impl<V: Clone> Clone for Vector3<V>

Source§

fn clone(&self) -> Vector3<V>

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<V: Debug> Debug for Vector3<V>

Source§

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

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

impl<V: PartialEq> PartialEq for Vector3<V>

Source§

fn eq(&self, other: &Vector3<V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V> VectorTrait for Vector3<V>

Source§

fn vector_shape_conformity_check(&self) -> Result<(), String>

Source§

fn norm(&self) -> Result<<Self as BasicOperationsTrait>::Value, String>
where <Self as BasicOperationsTrait>::Value: FloatTrait<Output = <Self as BasicOperationsTrait>::Value>,

Source§

fn dot_product( &self, other: &Self, ) -> Result<<Self as BasicOperationsTrait>::Value, String>
where <Self as BasicOperationsTrait>::Value: FloatTrait<Output = <Self as BasicOperationsTrait>::Value>, Self: Clone,

Source§

impl<V> StructuralPartialEq for Vector3<V>

Auto Trait Implementations§

§

impl<V> Freeze for Vector3<V>

§

impl<V> RefUnwindSafe for Vector3<V>
where V: RefUnwindSafe,

§

impl<V> Send for Vector3<V>
where V: Send,

§

impl<V> Sync for Vector3<V>
where V: Sync,

§

impl<V> Unpin for Vector3<V>
where V: Unpin,

§

impl<V> UnwindSafe for Vector3<V>
where V: 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.