pub struct Point2 {
pub x: f64,
pub y: f64,
}Expand description
2D point / vector.
Fields§
§x: f64§y: f64Implementations§
Source§impl Point2
impl Point2
pub fn new(x: f64, y: f64) -> Self
pub fn zero() -> Self
pub fn dot(self, other: Self) -> f64
pub fn cross(self, other: Self) -> f64
pub fn len_sq(self) -> f64
pub fn len(self) -> f64
pub fn normalize(self) -> Self
pub fn dist(self, other: Self) -> f64
pub fn perp(self) -> Self
Trait Implementations§
impl Copy for Point2
impl StructuralPartialEq for Point2
Auto Trait Implementations§
impl Freeze for Point2
impl RefUnwindSafe for Point2
impl Send for Point2
impl Sync for Point2
impl Unpin for Point2
impl UnsafeUnpin for Point2
impl UnwindSafe for Point2
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