pub struct FloatPoint<T: FloatNumber> {
pub x: T,
pub y: T,
}Fields§
§x: T§y: TImplementations§
Source§impl<T: FloatNumber> FloatPoint<T>
impl<T: FloatNumber> FloatPoint<T>
pub fn zero() -> Self
pub fn new(x: T, y: T) -> Self
pub fn dot_product(self, v: Self) -> T
pub fn cross_product(self, v: Self) -> T
pub fn sqr_length(&self) -> T
pub fn length(&self) -> T
pub fn normalize(&self) -> Self
Trait Implementations§
Source§impl<T: FloatNumber> Add for FloatPoint<T>
impl<T: FloatNumber> Add for FloatPoint<T>
Source§impl<T: FloatNumber> AddAssign for FloatPoint<T>
impl<T: FloatNumber> AddAssign for FloatPoint<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl<T: Clone + FloatNumber> Clone for FloatPoint<T>
impl<T: Clone + FloatNumber> Clone for FloatPoint<T>
Source§fn clone(&self) -> FloatPoint<T>
fn clone(&self) -> FloatPoint<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + FloatNumber> Debug for FloatPoint<T>
impl<T: Debug + FloatNumber> Debug for FloatPoint<T>
Source§impl<T: FloatNumber> Display for FloatPoint<T>
impl<T: FloatNumber> Display for FloatPoint<T>
Source§impl<T: FloatNumber> FloatPointCompatible for FloatPoint<T>
impl<T: FloatNumber> FloatPointCompatible for FloatPoint<T>
Source§impl<T: FloatNumber> Mul<T> for FloatPoint<T>
impl<T: FloatNumber> Mul<T> for FloatPoint<T>
Source§impl<T: FloatNumber> Neg for FloatPoint<T>
impl<T: FloatNumber> Neg for FloatPoint<T>
Source§impl<T: FloatNumber> Sub for FloatPoint<T>
impl<T: FloatNumber> Sub for FloatPoint<T>
impl<T: Copy + FloatNumber> Copy for FloatPoint<T>
Auto Trait Implementations§
impl<T> Freeze for FloatPoint<T>where
T: Freeze,
impl<T> RefUnwindSafe for FloatPoint<T>where
T: RefUnwindSafe,
impl<T> Send for FloatPoint<T>where
T: Send,
impl<T> Sync for FloatPoint<T>where
T: Sync,
impl<T> Unpin for FloatPoint<T>where
T: Unpin,
impl<T> UnsafeUnpin for FloatPoint<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FloatPoint<T>where
T: UnwindSafe,
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