pub struct FreeVector3D { /* private fields */ }Expand description
Concrete 3D geometry-vector implementation whose stored coordinates may be Cartesian, spherical, or cylindrical.
Implementations§
Source§impl FreeVector3D
impl FreeVector3D
Sourcepub fn new(x: GeometryMeasure, y: GeometryMeasure, z: GeometryMeasure) -> Self
pub fn new(x: GeometryMeasure, y: GeometryMeasure, z: GeometryMeasure) -> Self
Creates a vector from Cartesian x, y, and z components.
Sourcepub fn new_in_system(
first: GeometryMeasure,
second: GeometryMeasure,
third: GeometryMeasure,
coordinate_system: CoordinateSystem3D,
) -> Self
pub fn new_in_system( first: GeometryMeasure, second: GeometryMeasure, third: GeometryMeasure, coordinate_system: CoordinateSystem3D, ) -> Self
Creates a vector from raw coordinates in the specified system.
Sourcepub fn raw_components(&self) -> [GeometryMeasure; 3]
pub fn raw_components(&self) -> [GeometryMeasure; 3]
Returns the raw stored coordinates in the currently declared coordinate system.
Sourcepub fn cartesian_components(&self) -> [GeometryMeasure; 3]
pub fn cartesian_components(&self) -> [GeometryMeasure; 3]
Returns the Cartesian [x, y, z] representation of this vector.
Sourcepub fn coordinate_system(&self) -> CoordinateSystem3D
pub fn coordinate_system(&self) -> CoordinateSystem3D
Returns the current coordinate system.
Sourcepub fn set_coordinate_system(&mut self, coordinate_system: CoordinateSystem3D)
pub fn set_coordinate_system(&mut self, coordinate_system: CoordinateSystem3D)
Converts the stored coordinates to coordinate_system if needed.
Sourcepub fn converted_to(&self, coordinate_system: CoordinateSystem3D) -> Self
pub fn converted_to(&self, coordinate_system: CoordinateSystem3D) -> Self
Returns a copy represented in the requested coordinate system.
Sourcepub fn x(&self) -> GeometryMeasure
pub fn x(&self) -> GeometryMeasure
Returns the Cartesian x-component.
Sourcepub fn y(&self) -> GeometryMeasure
pub fn y(&self) -> GeometryMeasure
Returns the Cartesian y-component.
Sourcepub fn z(&self) -> GeometryMeasure
pub fn z(&self) -> GeometryMeasure
Returns the Cartesian z-component.
Trait Implementations§
Source§impl Add for FreeVector3D
impl Add for FreeVector3D
Source§impl Add<FreeVector3D> for CoordinateVector3D
impl Add<FreeVector3D> for CoordinateVector3D
Source§type Output = CoordinateVector3D
type Output = CoordinateVector3D
The resulting type after applying the
+ operator.Source§impl Add<f32> for FreeVector3D
impl Add<f32> for FreeVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
The resulting type after applying the
+ operator.Source§impl AsMut<f32> for FreeVector3D
impl AsMut<f32> for FreeVector3D
Source§fn as_mut(&mut self) -> &mut GeometryMeasure
fn as_mut(&mut self) -> &mut GeometryMeasure
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<f32> for FreeVector3D
impl AsRef<f32> for FreeVector3D
Source§fn as_ref(&self) -> &GeometryMeasure
fn as_ref(&self) -> &GeometryMeasure
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl CanNormalize for FreeVector3D
impl CanNormalize for FreeVector3D
Source§impl CanScale for FreeVector3D
impl CanScale for FreeVector3D
Source§fn scale(&mut self, factor: GeometryMeasure)
fn scale(&mut self, factor: GeometryMeasure)
Applies a uniform scaling factor.
Source§impl CanScaleNonUniform for FreeVector3D
impl CanScaleNonUniform for FreeVector3D
Source§type ScaleVector = FreeVector3D
type ScaleVector = FreeVector3D
Primitive used to represent non-uniform scale factors.
Source§fn scale_non_uniform(&mut self, factors: &Self::ScaleVector)
fn scale_non_uniform(&mut self, factors: &Self::ScaleVector)
Applies non-uniform scaling in place.
Source§impl Clone for FreeVector3D
impl Clone for FreeVector3D
impl CoordinatePrimitive for FreeVector3D
impl Copy for FreeVector3D
Source§impl CrossProduct for FreeVector3D
impl CrossProduct for FreeVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
Output type produced by the cross product.
Source§fn cross(&self, rhs: &Self) -> <Self as CrossProduct>::Output
fn cross(&self, rhs: &Self) -> <Self as CrossProduct>::Output
Computes the cross product.
Source§impl Debug for FreeVector3D
impl Debug for FreeVector3D
Source§impl Display for FreeVector3D
impl Display for FreeVector3D
Source§impl Div<f32> for FreeVector3D
impl Div<f32> for FreeVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
The resulting type after applying the
/ operator.Source§impl DotProduct for FreeVector3D
impl DotProduct for FreeVector3D
impl Eq for FreeVector3D
Source§impl From<FreeVector3D> for Quaternion
impl From<FreeVector3D> for Quaternion
Source§fn from(v: FreeVector3D) -> Self
fn from(v: FreeVector3D) -> Self
The pure quaternion of a vector.
impl GeometricPrimitive for FreeVector3D
impl GeometricPrimitive3D for FreeVector3D
Source§impl HasDimension for FreeVector3D
impl HasDimension for FreeVector3D
Source§impl HasNorm for FreeVector3D
impl HasNorm for FreeVector3D
Source§fn norm(&self) -> GeometryMeasure
fn norm(&self) -> GeometryMeasure
Returns the norm.
Source§impl Hash for FreeVector3D
impl Hash for FreeVector3D
Source§impl Index<usize> for FreeVector3D
impl Index<usize> for FreeVector3D
Source§impl IndexMut<usize> for FreeVector3D
impl IndexMut<usize> for FreeVector3D
Source§impl Mul for FreeVector3D
impl Mul for FreeVector3D
Source§impl Mul<f32> for FreeVector3D
impl Mul<f32> for FreeVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
The resulting type after applying the
* operator.Source§impl Normalize for FreeVector3D
impl Normalize for FreeVector3D
Source§fn normalized(&self) -> Self
fn normalized(&self) -> Self
Returns a normalized copy of
self.Source§impl PartialEq for FreeVector3D
impl PartialEq for FreeVector3D
impl ScalarOperable for FreeVector3D
impl SelfAddition for FreeVector3D
impl SelfProductInner for FreeVector3D
impl StructuralPartialEq for FreeVector3D
Source§impl Sub for FreeVector3D
impl Sub for FreeVector3D
Source§impl Sub<FreeVector3D> for CoordinateVector3D
impl Sub<FreeVector3D> for CoordinateVector3D
Source§type Output = CoordinateVector3D
type Output = CoordinateVector3D
The resulting type after applying the
- operator.Source§impl Sub<f32> for FreeVector3D
impl Sub<f32> for FreeVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
The resulting type after applying the
- operator.Source§impl ToCartesian for FreeVector3D
impl ToCartesian for FreeVector3D
Source§type Cartesian = FreeVector3D
type Cartesian = FreeVector3D
Cartesian result type.
Source§fn to_cartesian(&self) -> Self::Cartesian
fn to_cartesian(&self) -> Self::Cartesian
Returns the Cartesian representation of
self.Source§impl ToCylindrical for FreeVector3D
impl ToCylindrical for FreeVector3D
Source§type Cylindrical = FreeVector3D
type Cylindrical = FreeVector3D
Cylindrical result type.
Source§fn to_cylindrical(&self) -> Self::Cylindrical
fn to_cylindrical(&self) -> Self::Cylindrical
Returns the cylindrical representation of
self.Source§impl ToSpherical for FreeVector3D
impl ToSpherical for FreeVector3D
Source§type Spherical = FreeVector3D
type Spherical = FreeVector3D
Spherical result type.
Source§fn to_spherical(&self) -> Self::Spherical
fn to_spherical(&self) -> Self::Spherical
Returns the spherical representation of
self.Auto Trait Implementations§
impl Freeze for FreeVector3D
impl RefUnwindSafe for FreeVector3D
impl Send for FreeVector3D
impl Sync for FreeVector3D
impl Unpin for FreeVector3D
impl UnsafeUnpin for FreeVector3D
impl UnwindSafe for FreeVector3D
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