#[repr(C)]pub struct Point {
pub x: scalar,
pub y: scalar,
}
Fields§
§x: scalar
§y: scalar
Implementations§
Source§impl Point
impl Point
pub const fn new(x: scalar, y: scalar) -> Self
pub fn is_zero(self) -> bool
pub fn set(&mut self, x: scalar, y: scalar)
pub fn iset(&mut self, p: impl Into<IPoint>)
pub fn set_abs(&mut self, p: impl Into<Point>)
pub fn offset_points(points: &mut [Point], offset: impl Into<Vector>)
pub fn offset(&mut self, d: impl Into<Vector>)
pub fn length(self) -> scalar
pub fn distance_to_origin(self) -> scalar
pub fn normalize(&mut self) -> bool
pub fn set_normalize(&mut self, x: scalar, y: scalar) -> bool
pub fn set_length(&mut self, length: scalar) -> bool
pub fn set_length_xy(&mut self, x: scalar, y: scalar, length: scalar) -> bool
pub fn scaled(self, scale: scalar) -> Self
pub fn scale(&mut self, scale: scalar)
pub fn negate(&mut self)
pub fn is_finite(self) -> bool
pub fn equals(self, x: scalar, y: scalar) -> bool
pub fn length_xy(x: scalar, y: scalar) -> scalar
pub fn normalize_vector(v: &mut Vector) -> scalar
pub fn distance(a: Self, b: Self) -> scalar
pub fn dot_product(a: Self, b: Self) -> scalar
pub fn cross_product(a: Self, b: Self) -> scalar
pub fn cross(self, vec: Vector) -> scalar
pub fn dot(self, vec: Vector) -> scalar
Trait Implementations§
Source§impl AddAssign<Size> for Point
impl AddAssign<Size> for Point
Source§fn add_assign(&mut self, rhs: Size)
fn add_assign(&mut self, rhs: Size)
Performs the
+=
operation. Read moreSource§impl AddAssign for Point
impl AddAssign for Point
Source§fn add_assign(&mut self, rhs: Vector)
fn add_assign(&mut self, rhs: Vector)
Performs the
+=
operation. Read moreSource§impl DivAssign<f32> for Point
impl DivAssign<f32> for Point
Source§fn div_assign(&mut self, rhs: scalar)
fn div_assign(&mut self, rhs: scalar)
Performs the
/=
operation. Read moreSource§impl MulAssign<f32> for Point
impl MulAssign<f32> for Point
Source§fn mul_assign(&mut self, rhs: scalar)
fn mul_assign(&mut self, rhs: scalar)
Performs the
*=
operation. Read moreSource§impl SubAssign<Size> for Point
impl SubAssign<Size> for Point
Source§fn sub_assign(&mut self, rhs: Size)
fn sub_assign(&mut self, rhs: Size)
Performs the
-=
operation. Read moreSource§impl SubAssign for Point
impl SubAssign for Point
Source§fn sub_assign(&mut self, rhs: Vector)
fn sub_assign(&mut self, rhs: Vector)
Performs the
-=
operation. Read moreimpl Copy for Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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