#[repr(C, packed)]pub struct Point2<S> {
pub x: S,
pub y: S,
}
Expand description
A point in 2-dimensional space.
This type is marked as #[repr(C, packed)]
.
Fields§
§x: S
§y: S
Implementations§
Trait Implementations§
source§impl<S: BaseNum + AddAssign<S>> AddAssign<Vector2<S>> for Point2<S>
impl<S: BaseNum + AddAssign<S>> AddAssign<Vector2<S>> for Point2<S>
source§fn add_assign(&mut self, vector: Vector2<S>)
fn add_assign(&mut self, vector: Vector2<S>)
Performs the
+=
operation. Read moresource§impl<S: BaseNum> Array for Point2<S>
impl<S: BaseNum> Array for Point2<S>
type Element = S
source§fn from_value(scalar: S) -> Point2<S>
fn from_value(scalar: S) -> Point2<S>
Construct a vector from a single value, replicating it. Read more
source§fn min(self) -> Swhere
S: PartialOrd,
fn min(self) -> Swhere S: PartialOrd,
The minimum element of the array.
source§fn max(self) -> Swhere
S: PartialOrd,
fn max(self) -> Swhere S: PartialOrd,
The maximum element of the array.
source§fn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
source§fn swap_elements(&mut self, i: usize, j: usize)
fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices
i
and j
in-place.source§impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Point2<S>
impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Point2<S>
source§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
Performs the
/=
operation. Read moresource§impl<S: BaseNum> EuclideanSpace for Point2<S>
impl<S: BaseNum> EuclideanSpace for Point2<S>
source§impl<S: BaseFloat> MetricSpace for Point2<S>
impl<S: BaseFloat> MetricSpace for Point2<S>
source§impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Point2<S>
impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Point2<S>
source§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
Performs the
*=
operation. Read moresource§impl<S: PartialEq + Copy> PartialEq<Point2<S>> for Point2<S>
impl<S: PartialEq + Copy> PartialEq<Point2<S>> for Point2<S>
source§impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Point2<S>
impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Point2<S>
source§fn rem_assign(&mut self, scalar: S)
fn rem_assign(&mut self, scalar: S)
Performs the
%=
operation. Read moresource§impl<S: BaseFloat> Rotation<Point2<S>> for Basis2<S>
impl<S: BaseFloat> Rotation<Point2<S>> for Basis2<S>
source§fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Basis2<S>
fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Basis2<S>
Create a rotation to a given direction with an ‘up’ vector
source§fn between_vectors(a: Vector2<S>, b: Vector2<S>) -> Basis2<S>
fn between_vectors(a: Vector2<S>, b: Vector2<S>) -> Basis2<S>
Create a shortest rotation to transform vector ‘a’ into ‘b’.
Both given vectors are assumed to have unit length.
source§fn rotate_vector(&self, vec: Vector2<S>) -> Vector2<S>
fn rotate_vector(&self, vec: Vector2<S>) -> Vector2<S>
Rotate a vector using this rotation.
source§fn invert(&self) -> Basis2<S>
fn invert(&self) -> Basis2<S>
Create a new rotation which “un-does” this rotation. That is,
r * r.invert()
is the identity.source§fn rotate_point(&self, point: P) -> P
fn rotate_point(&self, point: P) -> P
Rotate a point using this rotation, by converting it to its
representation as a vector.
source§impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>
impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>
source§fn one() -> Matrix3<S>
fn one() -> Matrix3<S>
Create an identity transformation. That is, a transformation which
does nothing.
source§fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>
fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>
Transform a vector using this transform.
source§fn transform_point(&self, point: Point2<S>) -> Point2<S>
fn transform_point(&self, point: Point2<S>) -> Point2<S>
Transform a point using this transform.
source§fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
Combine this transform with another, yielding a new transformation
which has the effects of both.
source§fn inverse_transform(&self) -> Option<Matrix3<S>>
fn inverse_transform(&self) -> Option<Matrix3<S>>
Create a transform that “un-does” this one.
source§fn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
impl<S: Copy> Copy for Point2<S>
impl<S: Eq + Copy> Eq for Point2<S>
impl<S> StructuralEq for Point2<S>
impl<S> StructuralPartialEq for Point2<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Point2<S>where S: RefUnwindSafe,
impl<S> Send for Point2<S>where S: Send,
impl<S> Sync for Point2<S>where S: Sync,
impl<S> Unpin for Point2<S>where S: Unpin,
impl<S> UnwindSafe for Point2<S>where S: 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