Struct truck_geometry::base::cgmath::Vector4
pub struct Vector4<S> {
pub x: S,
pub y: S,
pub z: S,
pub w: S,
}
Expand description
A 4-dimensional vector.
This type is marked as #[repr(C)]
.
Fields§
§x: S
The x component of the vector.
y: S
The y component of the vector.
z: S
The z component of the vector.
w: S
The w component of the vector.
Implementations§
§impl<S> Vector4<S>
impl<S> Vector4<S>
Trait Implementations§
§impl<S> AbsDiffEq<Vector4<S>> for Vector4<S>where
S: BaseFloat,
impl<S> AbsDiffEq<Vector4<S>> for Vector4<S>where
S: BaseFloat,
§fn default_epsilon() -> <S as AbsDiffEq<S>>::Epsilon
fn default_epsilon() -> <S as AbsDiffEq<S>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
§fn abs_diff_eq(
&self,
other: &Vector4<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
fn abs_diff_eq(
&self,
other: &Vector4<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq
.§impl<S> AddAssign<Vector4<S>> for Vector4<S>where
S: BaseNum + AddAssign<S>,
impl<S> AddAssign<Vector4<S>> for Vector4<S>where
S: BaseNum + AddAssign<S>,
§fn add_assign(&mut self, other: Vector4<S>)
fn add_assign(&mut self, other: Vector4<S>)
Performs the
+=
operation. Read more§impl<S> Array for Vector4<S>where
S: Copy,
impl<S> Array for Vector4<S>where
S: Copy,
type Element = S
§fn from_value(scalar: S) -> Vector4<S>
fn from_value(scalar: S) -> Vector4<S>
Construct a vector from a single value, replicating it. Read more
§fn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
§fn swap_elements(&mut self, i: usize, j: usize)
fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices
i
and j
in-place.§impl<S> AsMut<(S, S, S, S)> for Vector4<S>
impl<S> AsMut<(S, S, S, S)> for Vector4<S>
§fn as_mut(&mut self) -> &mut (S, S, S, S)
fn as_mut(&mut self) -> &mut (S, S, S, S)
Converts this type into a mutable reference of the (usually inferred) input type.
§impl<S> AsRef<(S, S, S, S)> for Vector4<S>
impl<S> AsRef<(S, S, S, S)> for Vector4<S>
§fn as_ref(&self) -> &(S, S, S, S)
fn as_ref(&self) -> &(S, S, S, S)
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<S> ControlPoint<S> for Vector4<S>where
S: BaseFloat,
impl<S> ControlPoint<S> for Vector4<S>where
S: BaseFloat,
§impl<'de, S> Deserialize<'de> for Vector4<S>where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for Vector4<S>where
S: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Vector4<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Vector4<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<S> DivAssign<S> for Vector4<S>where
S: BaseNum + DivAssign<S>,
impl<S> DivAssign<S> for Vector4<S>where
S: BaseNum + DivAssign<S>,
§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
Performs the
/=
operation. Read more§impl<S> ElementWise<S> for Vector4<S>where
S: BaseNum,
impl<S> ElementWise<S> for Vector4<S>where
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Vector4<S>
fn sub_element_wise(self, rhs: S) -> Vector4<S>
fn mul_element_wise(self, rhs: S) -> Vector4<S>
fn div_element_wise(self, rhs: S) -> Vector4<S>
fn rem_element_wise(self, rhs: S) -> Vector4<S>
fn add_assign_element_wise(&mut self, rhs: S)
fn sub_assign_element_wise(&mut self, rhs: S)
fn mul_assign_element_wise(&mut self, rhs: S)
fn div_assign_element_wise(&mut self, rhs: S)
fn rem_assign_element_wise(&mut self, rhs: S)
§impl<S> ElementWise<Vector4<S>> for Vector4<S>where
S: BaseNum,
impl<S> ElementWise<Vector4<S>> for Vector4<S>where
S: BaseNum,
fn add_element_wise(self, rhs: Vector4<S>) -> Vector4<S>
fn sub_element_wise(self, rhs: Vector4<S>) -> Vector4<S>
fn mul_element_wise(self, rhs: Vector4<S>) -> Vector4<S>
fn div_element_wise(self, rhs: Vector4<S>) -> Vector4<S>
fn rem_element_wise(self, rhs: Vector4<S>) -> Vector4<S>
fn add_assign_element_wise(&mut self, rhs: Vector4<S>)
fn sub_assign_element_wise(&mut self, rhs: Vector4<S>)
fn mul_assign_element_wise(&mut self, rhs: Vector4<S>)
fn div_assign_element_wise(&mut self, rhs: Vector4<S>)
fn rem_assign_element_wise(&mut self, rhs: Vector4<S>)
§impl<'a, S> From<&'a (S, S, S, S)> for &'a Vector4<S>
impl<'a, S> From<&'a (S, S, S, S)> for &'a Vector4<S>
§fn from(v: &'a (S, S, S, S)) -> &'a Vector4<S>
fn from(v: &'a (S, S, S, S)) -> &'a Vector4<S>
Converts to this type from the input type.
§impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Vector4<S>
impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Vector4<S>
§fn from(v: &'a mut (S, S, S, S)) -> &'a mut Vector4<S>
fn from(v: &'a mut (S, S, S, S)) -> &'a mut Vector4<S>
Converts to this type from the input type.
§impl<S> From<(S, S, S, S)> for Vector4<S>
impl<S> From<(S, S, S, S)> for Vector4<S>
§fn from(v: (S, S, S, S)) -> Vector4<S>
fn from(v: (S, S, S, S)) -> Vector4<S>
Converts to this type from the input type.
source§impl<S> Homogeneous<S> for Vector4<S>where
S: BaseFloat,
impl<S> Homogeneous<S> for Vector4<S>where
S: BaseFloat,
source§fn from_point(point: <Vector4<S> as Homogeneous<S>>::Point) -> Vector4<S>
fn from_point(point: <Vector4<S> as Homogeneous<S>>::Point) -> Vector4<S>
Returns homogeneous coordinate.
source§fn from_point_weight(point: Self::Point, weight: S) -> Self
fn from_point_weight(point: Self::Point, weight: S) -> Self
Returns homogeneous coordinate from point and weight.
source§fn to_point(self) -> Self::Point
fn to_point(self) -> Self::Point
Returns the projection to the plane whose the last component is
1.0
.source§fn rat_der(self, der: Self) -> <Self::Point as EuclideanSpace>::Diff
fn rat_der(self, der: Self) -> <Self::Point as EuclideanSpace>::Diff
Returns the derivation of the rational curve. Read more
source§fn rat_der2(self, der: Self, der2: Self) -> <Self::Point as EuclideanSpace>::Diff
fn rat_der2(self, der: Self, der2: Self) -> <Self::Point as EuclideanSpace>::Diff
Returns the 2nd-ord derivation of the rational curve. Read more
source§fn rat_cross_der(
&self,
uder: Self,
vder: Self,
uvder: Self
) -> <Self::Point as EuclideanSpace>::Diff
fn rat_cross_der(
&self,
uder: Self,
vder: Self,
uvder: Self
) -> <Self::Point as EuclideanSpace>::Diff
Returns the cross derivation of the rational surface. Read more
§impl<S> InnerSpace for Vector4<S>where
S: BaseNum,
impl<S> InnerSpace for Vector4<S>where
S: BaseNum,
§fn magnitude2(self) -> Self::Scalar
fn magnitude2(self) -> Self::Scalar
Returns the squared magnitude. Read more
§fn project_on(self, other: Self) -> Self
fn project_on(self, other: Self) -> Self
Returns the
vector projection
of the current inner space projected onto the supplied argument.
§impl<S> Into<(S, S, S, S)> for Vector4<S>
impl<S> Into<(S, S, S, S)> for Vector4<S>
§fn into(self) -> (S, S, S, S)
fn into(self) -> (S, S, S, S)
Converts this type into the (usually inferred) input type.
§impl<S> MetricSpace for Vector4<S>where
S: BaseNum,
impl<S> MetricSpace for Vector4<S>where
S: BaseNum,
§impl<S> MulAssign<S> for Vector4<S>where
S: BaseNum + MulAssign<S>,
impl<S> MulAssign<S> for Vector4<S>where
S: BaseNum + MulAssign<S>,
§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
Performs the
*=
operation. Read more§impl<S> PartialEq<Vector4<S>> for Vector4<S>where
S: PartialEq<S>,
impl<S> PartialEq<Vector4<S>> for Vector4<S>where
S: PartialEq<S>,
§impl<S> RelativeEq<Vector4<S>> for Vector4<S>where
S: BaseFloat,
impl<S> RelativeEq<Vector4<S>> for Vector4<S>where
S: BaseFloat,
§fn default_max_relative() -> <S as AbsDiffEq<S>>::Epsilon
fn default_max_relative() -> <S as AbsDiffEq<S>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
§fn relative_eq(
&self,
other: &Vector4<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
fn relative_eq(
&self,
other: &Vector4<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of
RelativeEq::relative_eq
.§impl<S> RemAssign<S> for Vector4<S>where
S: BaseNum + RemAssign<S>,
impl<S> RemAssign<S> for Vector4<S>where
S: BaseNum + RemAssign<S>,
§fn rem_assign(&mut self, scalar: S)
fn rem_assign(&mut self, scalar: S)
Performs the
%=
operation. Read more§impl<S> Serialize for Vector4<S>where
S: Serialize,
impl<S> Serialize for Vector4<S>where
S: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl<S> SubAssign<Vector4<S>> for Vector4<S>where
S: BaseNum + SubAssign<S>,
impl<S> SubAssign<Vector4<S>> for Vector4<S>where
S: BaseNum + SubAssign<S>,
§fn sub_assign(&mut self, other: Vector4<S>)
fn sub_assign(&mut self, other: Vector4<S>)
Performs the
-=
operation. Read more