pub struct ScalarVector2<T>(/* private fields */)
where
T: Scalar;Expand description
Scalar vector of 2 elements
Trait Implementations§
Source§impl<T> Add<T> for ScalarVector2<T>where
T: Scalar,
impl<T> Add<T> for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
+ operator.Source§fn add(self, rhs: T) -> ScalarVector2<T>
fn add(self, rhs: T) -> ScalarVector2<T>
Performs the
+ operation. Read moreSource§impl<T> Add for ScalarVector2<T>where
T: Scalar,
impl<T> Add for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
+ operator.Source§fn add(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
fn add(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
Performs the
+ operation. Read moreSource§impl<T> Clone for ScalarVector2<T>
impl<T> Clone for ScalarVector2<T>
Source§fn clone(&self) -> ScalarVector2<T>
fn clone(&self) -> ScalarVector2<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for ScalarVector2<T>
impl<T> Debug for ScalarVector2<T>
Source§impl<T> Default for ScalarVector2<T>where
T: Scalar,
impl<T> Default for ScalarVector2<T>where
T: Scalar,
Source§fn default() -> ScalarVector2<T>
fn default() -> ScalarVector2<T>
Returns the “default value” for a type. Read more
Source§impl<T> Div<T> for ScalarVector2<T>where
T: Scalar,
impl<T> Div<T> for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
/ operator.Source§fn div(self, rhs: T) -> ScalarVector2<T>
fn div(self, rhs: T) -> ScalarVector2<T>
Performs the
/ operation. Read moreSource§impl<T> Div for ScalarVector2<T>where
T: Scalar,
impl<T> Div for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
/ operator.Source§fn div(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
fn div(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
Performs the
/ operation. Read moreSource§impl<T> Mul<T> for ScalarVector2<T>where
T: Scalar,
impl<T> Mul<T> for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: T) -> ScalarVector2<T>
fn mul(self, rhs: T) -> ScalarVector2<T>
Performs the
* operation. Read moreSource§impl<T> Mul for ScalarVector2<T>where
T: Scalar,
impl<T> Mul for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
fn mul(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
Performs the
* operation. Read moreSource§impl<T> Neg for ScalarVector2<T>where
T: Scalar,
impl<T> Neg for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
- operator.Source§fn neg(self) -> ScalarVector2<T>
fn neg(self) -> ScalarVector2<T>
Performs the unary
- operation. Read moreSource§impl<T> PartialEq for ScalarVector2<T>
impl<T> PartialEq for ScalarVector2<T>
Source§fn eq(&self, other: &ScalarVector2<T>) -> bool
fn eq(&self, other: &ScalarVector2<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T> Rem<T> for ScalarVector2<T>where
T: Scalar,
impl<T> Rem<T> for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
% operator.Source§fn rem(self, rhs: T) -> ScalarVector2<T>
fn rem(self, rhs: T) -> ScalarVector2<T>
Performs the
% operation. Read moreSource§impl<T> Rem for ScalarVector2<T>where
T: Scalar,
impl<T> Rem for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
% operator.Source§fn rem(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
fn rem(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
Performs the
% operation. Read moreSource§impl<T> Sub<T> for ScalarVector2<T>where
T: Scalar,
impl<T> Sub<T> for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
- operator.Source§fn sub(self, rhs: T) -> ScalarVector2<T>
fn sub(self, rhs: T) -> ScalarVector2<T>
Performs the
- operation. Read moreSource§impl<T> Sub for ScalarVector2<T>where
T: Scalar,
impl<T> Sub for ScalarVector2<T>where
T: Scalar,
Source§type Output = ScalarVector2<T>
type Output = ScalarVector2<T>
The resulting type after applying the
- operator.Source§fn sub(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
fn sub(self, rhs: ScalarVector2<T>) -> ScalarVector2<T>
Performs the
- operation. Read moreSource§impl<T> Vector<T, 2> for ScalarVector2<T>where
T: Scalar,
impl<T> Vector<T, 2> for ScalarVector2<T>where
T: Scalar,
Source§fn splat(value: T) -> ScalarVector2<T>
fn splat(value: T) -> ScalarVector2<T>
Construct a vector with all lanes set to the same value.
Source§fn load(slice: &[T]) -> ScalarVector2<T>
fn load(slice: &[T]) -> ScalarVector2<T>
Load a vector from a slice (panics if slice is too short).
Source§fn insert(&self, index: usize, value: T) -> ScalarVector2<T>
fn insert(&self, index: usize, value: T) -> ScalarVector2<T>
Return a new vector with the value at the given lane replaced.
Source§fn add(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn add(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise addition.
Source§fn sub(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn sub(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise subtraction.
Source§fn mul(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn mul(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise multiplication.
Source§fn div(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn div(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise division.
Source§fn rem(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn rem(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise remainder.
Source§fn neg(&self) -> ScalarVector2<T>
fn neg(&self) -> ScalarVector2<T>
Lane-wise negation.
Source§fn abs(&self) -> ScalarVector2<T>
fn abs(&self) -> ScalarVector2<T>
Lane-wise absolute value.
Source§fn min(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn min(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise minimum.
Source§fn max(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
fn max(&self, other: &ScalarVector2<T>) -> ScalarVector2<T>
Lane-wise maximum.
Source§fn clamp(
&self,
min: &ScalarVector2<T>,
max: &ScalarVector2<T>,
) -> ScalarVector2<T>
fn clamp( &self, min: &ScalarVector2<T>, max: &ScalarVector2<T>, ) -> ScalarVector2<T>
Lane-wise clamp to the inclusive range
[min, max].Source§impl<T> VectorTranscendental<T, 2> for ScalarVector2<T>where
T: Transcendental,
impl<T> VectorTranscendental<T, 2> for ScalarVector2<T>where
T: Transcendental,
Source§fn sqrt(&self) -> ScalarVector2<T>
fn sqrt(&self) -> ScalarVector2<T>
Lane-wise square root.
Source§fn exp(&self) -> ScalarVector2<T>
fn exp(&self) -> ScalarVector2<T>
Lane-wise exponential (e^x).
Source§fn ln(&self) -> ScalarVector2<T>
fn ln(&self) -> ScalarVector2<T>
Lane-wise natural logarithm.
Source§fn sin(&self) -> ScalarVector2<T>
fn sin(&self) -> ScalarVector2<T>
Lane-wise sine (input in radians).
Source§fn cos(&self) -> ScalarVector2<T>
fn cos(&self) -> ScalarVector2<T>
Lane-wise cosine (input in radians).
Source§fn tan(&self) -> ScalarVector2<T>
fn tan(&self) -> ScalarVector2<T>
Lane-wise tangent (input in radians).
impl<T> Copy for ScalarVector2<T>
impl<T> StructuralPartialEq for ScalarVector2<T>where
T: Scalar,
Auto Trait Implementations§
impl<T> Freeze for ScalarVector2<T>where
T: Freeze,
impl<T> RefUnwindSafe for ScalarVector2<T>where
T: RefUnwindSafe,
impl<T> Send for ScalarVector2<T>
impl<T> Sync for ScalarVector2<T>
impl<T> Unpin for ScalarVector2<T>where
T: Unpin,
impl<T> UnsafeUnpin for ScalarVector2<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ScalarVector2<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, const N: usize, V> VectorReduce<T, N> for V
impl<T, const N: usize, V> VectorReduce<T, N> for V
Source§fn horizontal_sum(&self) -> T
fn horizontal_sum(&self) -> T
Sum of all lanes.
Source§fn horizontal_product(&self) -> T
fn horizontal_product(&self) -> T
Product of all lanes.
Source§fn horizontal_min(&self) -> T
fn horizontal_min(&self) -> T
Minimum value across all lanes.
Source§fn horizontal_max(&self) -> T
fn horizontal_max(&self) -> T
Maximum value across all lanes.
Source§fn horizontal_mean(&self) -> T
fn horizontal_mean(&self) -> T
Arithmetic mean of all lanes.
Source§impl<T, const N: usize, V> VectorScalarOps<T, N> for V
impl<T, const N: usize, V> VectorScalarOps<T, N> for V
Source§fn add_scalar(&self, scalar: T) -> Self
fn add_scalar(&self, scalar: T) -> Self
Add a scalar to every lane.
Source§fn sub_scalar(&self, scalar: T) -> Self
fn sub_scalar(&self, scalar: T) -> Self
Subtract a scalar from every lane.
Source§fn mul_scalar(&self, scalar: T) -> Self
fn mul_scalar(&self, scalar: T) -> Self
Multiply every lane by a scalar.
Source§fn div_scalar(&self, scalar: T) -> Self
fn div_scalar(&self, scalar: T) -> Self
Divide every lane by a scalar.
Source§fn rem_scalar(&self, scalar: T) -> Self
fn rem_scalar(&self, scalar: T) -> Self
Compute the remainder of every lane divided by a scalar.