pub struct UnitVector3D { /* private fields */ }Expand description
Concrete 3D unit-vector implementation whose stored coordinates may be Cartesian, spherical, or cylindrical.
Implementations§
Source§impl UnitVector3D
impl UnitVector3D
Sourcepub fn new(x: GeometryMeasure, y: GeometryMeasure, z: GeometryMeasure) -> Self
pub fn new(x: GeometryMeasure, y: GeometryMeasure, z: GeometryMeasure) -> Self
Creates and normalizes a vector from Cartesian coordinates.
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 and normalizes a vector from raw coordinates in the supplied system.
Sourcepub fn from_vector(vector: FreeVector3D) -> Self
pub fn from_vector(vector: FreeVector3D) -> Self
Creates a unit vector by normalizing a free geometry vector.
Sourcepub fn as_vector(self) -> FreeVector3D
pub fn as_vector(self) -> FreeVector3D
Returns this unit vector as a free geometry vector with the same components.
Sourcepub fn raw_components(&self) -> [GeometryMeasure; 3]
pub fn raw_components(&self) -> [GeometryMeasure; 3]
Returns the raw stored coordinates in the current 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 AsMut<f32> for UnitVector3D
impl AsMut<f32> for UnitVector3D
Source§fn as_mut(&mut self) -> &mut GeometryMeasure
fn as_mut(&mut self) -> &mut GeometryMeasure
Source§impl AsRef<f32> for UnitVector3D
impl AsRef<f32> for UnitVector3D
Source§fn as_ref(&self) -> &GeometryMeasure
fn as_ref(&self) -> &GeometryMeasure
Source§impl CanNormalize for UnitVector3D
impl CanNormalize for UnitVector3D
Source§impl Clone for UnitVector3D
impl Clone for UnitVector3D
impl CoordinatePrimitive for UnitVector3D
impl Copy for UnitVector3D
Source§impl CrossProduct for UnitVector3D
impl CrossProduct for UnitVector3D
Source§type Output = FreeVector3D
type Output = FreeVector3D
Source§fn cross(&self, rhs: &Self) -> <Self as CrossProduct>::Output
fn cross(&self, rhs: &Self) -> <Self as CrossProduct>::Output
Source§impl Debug for UnitVector3D
impl Debug for UnitVector3D
Source§impl Display for UnitVector3D
impl Display for UnitVector3D
Source§impl DotProduct for UnitVector3D
impl DotProduct for UnitVector3D
impl Eq for UnitVector3D
impl GeometricPrimitive for UnitVector3D
impl GeometricPrimitive3D for UnitVector3D
Source§impl HasDimension for UnitVector3D
impl HasDimension for UnitVector3D
Source§impl HasNorm for UnitVector3D
impl HasNorm for UnitVector3D
Source§fn norm(&self) -> GeometryMeasure
fn norm(&self) -> GeometryMeasure
Source§impl Hash for UnitVector3D
impl Hash for UnitVector3D
Source§impl Index<usize> for UnitVector3D
impl Index<usize> for UnitVector3D
Source§impl IndexMut<usize> for UnitVector3D
impl IndexMut<usize> for UnitVector3D
Source§impl<'a> IsMesh<'a, CoordinateVector3D, UnitVector3D> for SurfaceMesh3D
impl<'a> IsMesh<'a, CoordinateVector3D, UnitVector3D> for SurfaceMesh3D
Source§fn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>
fn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>
Source§fn set_face_id(
&mut self,
index: usize,
face_id: FaceId,
) -> Result<(), ErrorsJSL>
fn set_face_id( &mut self, index: usize, face_id: FaceId, ) -> Result<(), ErrorsJSL>
Source§fn surface_area(&self) -> GeometryMeasure
fn surface_area(&self) -> GeometryMeasure
Source§fn face_count(&self) -> usize
fn face_count(&self) -> usize
Source§fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>
fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>
Source§fn face_normal(&self, index: usize) -> Option<N>
fn face_normal(&self, index: usize) -> Option<N>
Source§impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for PolygonFace3D
impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for PolygonFace3D
Source§fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
Source§fn set_vertex_id(
&mut self,
index: usize,
point_id: PointId,
) -> Result<(), ErrorsJSL>
fn set_vertex_id( &mut self, index: usize, point_id: PointId, ) -> Result<(), ErrorsJSL>
Source§fn normal(&self) -> UnitVector3D
fn normal(&self) -> UnitVector3D
Source§fn perimeter(&self) -> GeometryMeasure
fn perimeter(&self) -> GeometryMeasure
Source§fn area(&self) -> GeometryMeasure
fn area(&self) -> GeometryMeasure
Source§fn plane(
&self,
) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
fn plane( &self, ) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
Source§impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
Source§fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
Source§fn set_vertex_id(
&mut self,
index: usize,
point_id: PointId,
) -> Result<(), ErrorsJSL>
fn set_vertex_id( &mut self, index: usize, point_id: PointId, ) -> Result<(), ErrorsJSL>
Source§fn normal(&self) -> UnitVector3D
fn normal(&self) -> UnitVector3D
Source§fn perimeter(&self) -> GeometryMeasure
fn perimeter(&self) -> GeometryMeasure
Source§fn area(&self) -> GeometryMeasure
fn area(&self) -> GeometryMeasure
Source§fn plane(
&self,
) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
fn plane( &self, ) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
Source§impl<'a> IsTetrahedron<'a, CoordinateVector3D, UnitVector3D> for Tetrahedron3D
impl<'a> IsTetrahedron<'a, CoordinateVector3D, UnitVector3D> for Tetrahedron3D
Source§fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Source§fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Source§fn set_c_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_c_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Source§fn set_d_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_d_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Source§fn faces(&self) -> [Triangle3D; 4]
fn faces(&self) -> [Triangle3D; 4]
Source§fn face_count(&self) -> usize
fn face_count(&self) -> usize
Source§fn surface_area(&self) -> GeometryMeasure
fn surface_area(&self) -> GeometryMeasure
Source§fn signed_volume(&self) -> GeometryMeasure
fn signed_volume(&self) -> GeometryMeasure
Source§fn volume(&self) -> GeometryMeasure
fn volume(&self) -> GeometryMeasure
Source§impl<'a> IsTriangle<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
impl<'a> IsTriangle<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
Source§fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Source§fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
impl IsUnitVector for UnitVector3D
Source§impl<'a> IsVolumeMesh<'a, CoordinateVector3D, UnitVector3D> for VolumeMesh3D
impl<'a> IsVolumeMesh<'a, CoordinateVector3D, UnitVector3D> for VolumeMesh3D
Source§fn tetrahedron_ids(&self) -> Box<dyn Iterator<Item = TetrahedronId> + '_>
fn tetrahedron_ids(&self) -> Box<dyn Iterator<Item = TetrahedronId> + '_>
Source§fn set_tetrahedron_id(
&mut self,
index: usize,
tetrahedron_id: TetrahedronId,
) -> Result<(), ErrorsJSL>
fn set_tetrahedron_id( &mut self, index: usize, tetrahedron_id: TetrahedronId, ) -> Result<(), ErrorsJSL>
Source§fn volume(&self) -> GeometryMeasure
fn volume(&self) -> GeometryMeasure
Source§fn tetrahedron_count(&self) -> usize
fn tetrahedron_count(&self) -> usize
Source§fn tetrahedron(
&self,
index: usize,
) -> Option<<Self as HasTetrahedra<'a>>::Tetrahedron>
fn tetrahedron( &self, index: usize, ) -> Option<<Self as HasTetrahedra<'a>>::Tetrahedron>
Source§impl Normalize for UnitVector3D
impl Normalize for UnitVector3D
Source§fn normalized(&self) -> Self
fn normalized(&self) -> Self
self.Source§impl PartialEq for UnitVector3D
impl PartialEq for UnitVector3D
impl StructuralPartialEq for UnitVector3D
Source§impl ToCartesian for UnitVector3D
impl ToCartesian for UnitVector3D
Source§type Cartesian = UnitVector3D
type Cartesian = UnitVector3D
Source§fn to_cartesian(&self) -> Self::Cartesian
fn to_cartesian(&self) -> Self::Cartesian
self.Source§impl ToCylindrical for UnitVector3D
impl ToCylindrical for UnitVector3D
Source§type Cylindrical = UnitVector3D
type Cylindrical = UnitVector3D
Source§fn to_cylindrical(&self) -> Self::Cylindrical
fn to_cylindrical(&self) -> Self::Cylindrical
self.Source§impl ToSpherical for UnitVector3D
impl ToSpherical for UnitVector3D
Source§type Spherical = UnitVector3D
type Spherical = UnitVector3D
Source§fn to_spherical(&self) -> Self::Spherical
fn to_spherical(&self) -> Self::Spherical
self.