pub struct Point3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
A point or vector in 3D. Serialized as a three-element array.
Fields§
§x: f64§y: f64§z: f64Implementations§
Source§impl Point3
impl Point3
pub const ZERO: Point3
pub const X: Point3
pub const Y: Point3
pub const Z: Point3
pub const fn new(x: f64, y: f64, z: f64) -> Self
pub fn is_finite(&self) -> bool
pub fn add(self, o: Point3) -> Point3
pub fn sub(self, o: Point3) -> Point3
pub fn scale(self, s: f64) -> Point3
pub fn dot(self, o: Point3) -> f64
pub fn cross(self, o: Point3) -> Point3
pub fn length_squared(self) -> f64
pub fn length(self) -> f64
Sourcepub fn normalized(self) -> Option<Point3>
pub fn normalized(self) -> Option<Point3>
Unit vector in this direction; None for a zero or non-finite vector.
pub fn distance(self, o: Point3) -> f64
Sourcepub fn distance_xy(self, o: Point3) -> f64
pub fn distance_xy(self, o: Point3) -> f64
Distance in the XY plane only (the cutter-axis projection).
pub fn lerp(self, o: Point3, t: f64) -> Point3
pub fn min(self, o: Point3) -> Point3
pub fn max(self, o: Point3) -> Point3
Trait Implementations§
impl Copy for Point3
Source§impl<'de> Deserialize<'de> for Point3
impl<'de> Deserialize<'de> for Point3
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Point3
Auto Trait Implementations§
impl Freeze for Point3
impl RefUnwindSafe for Point3
impl Send for Point3
impl Sync for Point3
impl Unpin for Point3
impl UnsafeUnpin for Point3
impl UnwindSafe for Point3
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