#[repr(C)]pub struct Point_<T> {
pub x: T,
pub y: T,
}
Expand description
Fields§
§x: T
§y: T
Implementations§
source§impl<T> Point_<T>
impl<T> Point_<T>
pub fn new(x: T, y: T) -> Self
pub fn from_vec2(vec: VecN<T, 2>) -> Self
pub fn from_size(sz: Size_<T>) -> Self
pub fn cross(self, pt: Point_<T>) -> f64where f64: From<T>,
pub fn dot(self, pt: Point_<T>) -> Twhere T: NumOps,
pub fn ddot(self, pt: Point_<T>) -> f64where f64: From<T>,
pub fn inside(self, rect: Rect_<T>) -> boolwhere T: PartialOrd + Add<Output = T> + Copy,
pub fn norm(self) -> f64where f64: From<T>,
pub fn to<D: NumCast>(self) -> Option<Point_<D>>where T: ToPrimitive,
pub fn to_vec2(self) -> VecN<T, 2>
Trait Implementations§
source§impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
source§fn add_assign(&mut self, rhs: Point_<P>)
fn add_assign(&mut self, rhs: Point_<P>)
Performs the
+=
operation. Read moresource§impl<T: AddAssign> AddAssign<Point_<T>> for Point_<T>
impl<T: AddAssign> AddAssign<Point_<T>> for Point_<T>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<T: DataType> DataType for Point_<T>
impl<T: DataType> DataType for Point_<T>
source§impl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
impl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moresource§impl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
impl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moresource§impl<T: PartialEq> PartialEq<Point_<T>> for Point_<T>
impl<T: PartialEq> PartialEq<Point_<T>> for Point_<T>
source§impl<T: PartialOrd> PartialOrd<Point_<T>> for Point_<T>
impl<T: PartialOrd> PartialOrd<Point_<T>> for Point_<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
source§fn sub_assign(&mut self, rhs: Point_<P>)
fn sub_assign(&mut self, rhs: Point_<P>)
Performs the
-=
operation. Read moresource§impl<T: SubAssign> SubAssign<Point_<T>> for Point_<T>
impl<T: SubAssign> SubAssign<Point_<T>> for Point_<T>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read more