Struct scad_tree_math::Pt2
source · pub struct Pt2 {
pub x: f64,
pub y: f64,
}
Expand description
A 2D point.
Fields§
§x: f64
§y: f64
Implementations§
source§impl Pt2
impl Pt2
pub fn new(x: f64, y: f64) -> Self
pub fn dot(self, rhs: Pt2) -> f64
pub fn len2(self) -> f64
pub fn len(self) -> f64
pub fn normalize(&mut self)
pub fn normalized(self) -> Self
pub fn rotate(&mut self, degrees: f64)
pub fn rotated(self, degrees: f64) -> Self
pub fn lerp(self, b: Self, t: f64) -> Self
pub fn to_xz(self) -> Pt3
pub fn as_pt3(self, z: f64) -> Pt3
Trait Implementations§
source§impl AddAssign for Pt2
impl AddAssign for Pt2
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl DivAssign<f64> for Pt2
impl DivAssign<f64> for Pt2
source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/=
operation. Read moresource§impl MulAssign<f64> for Pt2
impl MulAssign<f64> for Pt2
source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*=
operation. Read moresource§impl SubAssign for Pt2
impl SubAssign for Pt2
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl Copy for Pt2
impl StructuralPartialEq for Pt2
Auto Trait Implementations§
impl RefUnwindSafe for Pt2
impl Send for Pt2
impl Sync for Pt2
impl Unpin for Pt2
impl UnwindSafe for Pt2
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