#[repr(C)]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)].
Fields§
§x: S§y: SImplementations§
Trait Implementations§
Source§impl<S> AbsDiffEq for Point2<S>where
S: BaseFloat,
impl<S> AbsDiffEq for Point2<S>where
S: BaseFloat,
Source§fn default_epsilon() -> <S as AbsDiffEq>::Epsilon
fn default_epsilon() -> <S as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Point2<S>, epsilon: <S as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl<S> AddAssign<Vector2<S>> for Point2<S>
impl<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> Array for Point2<S>where
S: BaseNum,
impl<S> Array for Point2<S>where
S: BaseNum,
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 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> DivAssign<S> for Point2<S>
impl<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> ElementWise<S> for Point2<S>where
S: BaseNum,
impl<S> ElementWise<S> for Point2<S>where
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Point2<S>
fn sub_element_wise(self, rhs: S) -> Point2<S>
fn mul_element_wise(self, rhs: S) -> Point2<S>
fn div_element_wise(self, rhs: S) -> Point2<S>
fn rem_element_wise(self, rhs: S) -> Point2<S>
fn add_assign_element_wise(&mut self, rhs: S)
fn sub_assign_element_wise(&mut self, rhs: S)
fn mul_assign_element_wise(&mut self, rhs: S)
fn div_assign_element_wise(&mut self, rhs: S)
fn rem_assign_element_wise(&mut self, rhs: S)
Source§impl<S> ElementWise for Point2<S>where
S: BaseNum,
impl<S> ElementWise for Point2<S>where
S: BaseNum,
fn add_element_wise(self, rhs: Point2<S>) -> Point2<S>
fn sub_element_wise(self, rhs: Point2<S>) -> Point2<S>
fn mul_element_wise(self, rhs: Point2<S>) -> Point2<S>
fn div_element_wise(self, rhs: Point2<S>) -> Point2<S>
fn rem_element_wise(self, rhs: Point2<S>) -> Point2<S>
fn add_assign_element_wise(&mut self, rhs: Point2<S>)
fn sub_assign_element_wise(&mut self, rhs: Point2<S>)
fn mul_assign_element_wise(&mut self, rhs: Point2<S>)
fn div_assign_element_wise(&mut self, rhs: Point2<S>)
fn rem_assign_element_wise(&mut self, rhs: Point2<S>)
Source§impl<S> EuclideanSpace for Point2<S>where
S: BaseNum,
impl<S> EuclideanSpace for Point2<S>where
S: BaseNum,
Source§impl<S> MetricSpace for Point2<S>where
S: BaseFloat,
impl<S> MetricSpace for Point2<S>where
S: BaseFloat,
Source§impl<S> MulAssign<S> for Point2<S>
impl<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> RelativeEq for Point2<S>where
S: BaseFloat,
impl<S> RelativeEq for Point2<S>where
S: BaseFloat,
Source§fn default_max_relative() -> <S as AbsDiffEq>::Epsilon
fn default_max_relative() -> <S as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq>::Epsilon,
max_relative: <S as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Point2<S>, epsilon: <S as AbsDiffEq>::Epsilon, max_relative: <S as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<S> RemAssign<S> for Point2<S>
impl<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> SubAssign<Vector2<S>> for Point2<S>
impl<S> SubAssign<Vector2<S>> for Point2<S>
Source§fn sub_assign(&mut self, vector: Vector2<S>)
fn sub_assign(&mut self, vector: Vector2<S>)
Performs the
-= operation. Read moreSource§impl<S> Transform<Point2<S>> for Matrix3<S>where
S: BaseFloat,
impl<S> Transform<Point2<S>> for Matrix3<S>where
S: BaseFloat,
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>
👎Deprecated: Use look_at_rh or look_at_lh
Create a transformation that rotates a vector to look at
center from
eye, using up for orientation.Source§fn look_at_lh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at_lh(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 look_at_rh(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
fn look_at_rh(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 inverse_transform_vector(
&self,
vec: <P as EuclideanSpace>::Diff,
) -> Option<<P as EuclideanSpace>::Diff>
fn inverse_transform_vector( &self, vec: <P as EuclideanSpace>::Diff, ) -> Option<<P as EuclideanSpace>::Diff>
Inverse transform a vector using this transform
Source§fn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
Source§impl<S> UlpsEq for Point2<S>where
S: BaseFloat,
impl<S> UlpsEq for Point2<S>where
S: BaseFloat,
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
Source§impl<Scalar> X2BasicInterface for Point2<Scalar>where
Scalar: ScalarInterface,
impl<Scalar> X2BasicInterface for Point2<Scalar>where
Scalar: ScalarInterface,
Source§fn make(
_0: <Point2<Scalar> as X2NominalInterface>::Scalar,
_1: <Point2<Scalar> as X2NominalInterface>::Scalar,
) -> Point2<Scalar>
fn make( _0: <Point2<Scalar> as X2NominalInterface>::Scalar, _1: <Point2<Scalar> as X2NominalInterface>::Scalar, ) -> Point2<Scalar>
Constructor.
Source§fn make_default() -> Selfwhere
Self: Sized,
fn make_default() -> Selfwhere
Self: Sized,
Make an instance filling fields with default values.
Source§impl<Scalar> X2CanonicalInterface for Point2<Scalar>where
Scalar: ScalarInterface,
impl<Scalar> X2CanonicalInterface for Point2<Scalar>where
Scalar: ScalarInterface,
Source§fn as_canonical(&self) -> &X2<<Point2<Scalar> as X2NominalInterface>::Scalar>
fn as_canonical(&self) -> &X2<<Point2<Scalar> as X2NominalInterface>::Scalar>
Canonical representation of the vector.
Source§fn as_canonical_mut(
&mut self,
) -> &mut X2<<Point2<Scalar> as X2NominalInterface>::Scalar>
fn as_canonical_mut( &mut self, ) -> &mut X2<<Point2<Scalar> as X2NominalInterface>::Scalar>
Mutable canonical representation of the vector.
Source§fn assign<Src>(&mut self, src: Src)where
Src: X2BasicInterface<Scalar = Self::Scalar>,
fn assign<Src>(&mut self, src: Src)where
Src: X2BasicInterface<Scalar = Self::Scalar>,
Assign value.
Source§fn as_tuple_mut(&mut self) -> &mut (Self::Scalar, Self::Scalar)
fn as_tuple_mut(&mut self) -> &mut (Self::Scalar, Self::Scalar)
Interpret as mutable tuple.
Source§fn as_array_mut(&mut self) -> &mut [Self::Scalar; 2]
fn as_array_mut(&mut self) -> &mut [Self::Scalar; 2]
Interpret as mutable array.
Source§fn as_slice_mut(&mut self) -> &mut [Self::Scalar]
fn as_slice_mut(&mut self) -> &mut [Self::Scalar]
Interpret as mutable slice.
Source§impl<Scalar> X2NominalInterface for Point2<Scalar>where
Scalar: ScalarInterface,
impl<Scalar> X2NominalInterface for Point2<Scalar>where
Scalar: ScalarInterface,
Source§fn clone_as_tuple(&self) -> (Self::Scalar, Self::Scalar)
fn clone_as_tuple(&self) -> (Self::Scalar, Self::Scalar)
Clone as tuple.
Source§fn clone_as_array(&self) -> [Self::Scalar; 2]
fn clone_as_array(&self) -> [Self::Scalar; 2]
Clone as array.
Source§fn clone_as_canonical(&self) -> X2<Self::Scalar>
fn clone_as_canonical(&self) -> X2<Self::Scalar>
Clone as canonical.
impl<S> Copy for Point2<S>where
S: Copy,
impl<S> Eq for Point2<S>where
S: Eq,
impl<S> StructuralPartialEq for Point2<S>
Auto Trait Implementations§
impl<S> Freeze for Point2<S>where
S: Freeze,
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<Scalar, Any> AsCgmathCanonicalInterface<Vector2<Scalar>> for Any
impl<Scalar, Any> AsCgmathCanonicalInterface<Vector2<Scalar>> for Any
Source§impl<Scalar, Any> AsCgmathNonCanonicalInterface<Vector2<Scalar>> for Any
impl<Scalar, Any> AsCgmathNonCanonicalInterface<Vector2<Scalar>> for Any
Source§fn clone_as_cgmath(&self) -> Vector2<Scalar>
fn clone_as_cgmath(&self) -> Vector2<Scalar>
Clone this data structure as cgmath analog to use its operations.
Source§impl<T, Any> AsForeignCanonicalInterface<T> for Any
impl<T, Any> AsForeignCanonicalInterface<T> for Any
Source§fn as_foreign(&self) -> &T
fn as_foreign(&self) -> &T
Interpret this data structure as nalgebra analog to use its operations.
Source§fn as_foreign_mut(&mut self) -> &mut T
fn as_foreign_mut(&mut self) -> &mut T
Interpret this data structure mutably as nalgebra analog to use its operations.
Source§impl<T, Any> AsForeignNonCanonicalInterface<T> for Any
impl<T, Any> AsForeignNonCanonicalInterface<T> for Any
Source§fn clone_as_foreign(&self) -> T
fn clone_as_foreign(&self) -> T
Clone this data structure as analog of a math lib of choice to use its operations.
Source§impl<Scalar, Any> AsNalgebraCanonicalInterface<Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>> for Any
impl<Scalar, Any> AsNalgebraCanonicalInterface<Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>> for Any
Source§fn as_nalgebra(
&self,
) -> &Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
fn as_nalgebra( &self, ) -> &Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
Interpret this data structure as nalgebra analog to use its operations.
Source§fn as_nalgebra_mut(
&mut self,
) -> &mut Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
fn as_nalgebra_mut( &mut self, ) -> &mut Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
Interpret this data structure mutably as nalgebra analog to use its operations.
Source§impl<Scalar, Any> AsNalgebraNonCanonicalInterface<Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>> for Any
impl<Scalar, Any> AsNalgebraNonCanonicalInterface<Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>> for Any
Source§fn clone_as_nalgebra(
&self,
) -> Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
fn clone_as_nalgebra( &self, ) -> Matrix<Scalar, Const<2>, Const<1>, ArrayStorage<Scalar, 2, 1>>
Clone this data structure as nalgebra analog to use its operations.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Scalar, Original, Target> From2<Original> for Targetwhere
Scalar: ScalarInterface,
Original: X2NominalInterface<Scalar = Scalar>,
Target: X2BasicInterface<Scalar = Scalar>,
impl<Scalar, Original, Target> From2<Original> for Targetwhere
Scalar: ScalarInterface,
Original: X2NominalInterface<Scalar = Scalar>,
Target: X2BasicInterface<Scalar = Scalar>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere
T: Bounded,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.