[−][src]Struct youxi::prelude::Point2
A point in 2-dimensional space.
This type is marked as #[repr(C)]
.
Fields
x: S
y: S
Methods
impl<S> Point2<S>
[src]
pub const fn new(x: S, y: S) -> Point2<S>
[src]
Construct a new point, using the provided values.
pub fn map<U, F>(self, f: F) -> Point2<U> where
F: FnMut(S) -> U,
[src]
F: FnMut(S) -> U,
Perform the given operation on each field in the point, returning a new point constructed from the operations.
impl<S> Point2<S> where
S: Copy + NumCast,
[src]
S: Copy + NumCast,
pub fn cast<T>(&self) -> Option<Point2<T>> where
T: NumCast,
[src]
T: NumCast,
Component-wise casting to another type
Trait Implementations
impl<S> ElementWise<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Point2<S>
[src]
fn sub_element_wise(self, rhs: S) -> Point2<S>
[src]
fn mul_element_wise(self, rhs: S) -> Point2<S>
[src]
fn div_element_wise(self, rhs: S) -> Point2<S>
[src]
fn rem_element_wise(self, rhs: S) -> Point2<S>
[src]
fn add_assign_element_wise(&mut self, rhs: S)
[src]
fn sub_assign_element_wise(&mut self, rhs: S)
[src]
fn mul_assign_element_wise(&mut self, rhs: S)
[src]
fn div_assign_element_wise(&mut self, rhs: S)
[src]
fn rem_assign_element_wise(&mut self, rhs: S)
[src]
impl<S> ElementWise<Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
fn add_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn sub_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn mul_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn div_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn rem_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn add_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn sub_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn mul_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn div_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn rem_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
impl<S> PartialEq<Point2<S>> for Point2<S> where
S: PartialEq<S>,
[src]
S: PartialEq<S>,
impl<S> Bounded for Point2<S> where
S: Bounded,
[src]
S: Bounded,
impl<S> RemAssign<S> for Point2<S> where
S: BaseNum + RemAssign<S>,
[src]
S: BaseNum + RemAssign<S>,
fn rem_assign(&mut self, scalar: S)
[src]
impl<S> Mul<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Point2<S>
[src]
impl<'a, S> Mul<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Point2<S>
[src]
impl<S> AbsDiffEq<Point2<S>> for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Epsilon = <S as AbsDiffEq<S>>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <S as AbsDiffEq<S>>::Epsilon
[src]
fn abs_diff_eq(
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
[src]
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of ApproxEq::abs_diff_eq
.
impl<S> DivAssign<S> for Point2<S> where
S: BaseNum + DivAssign<S>,
[src]
S: BaseNum + DivAssign<S>,
fn div_assign(&mut self, scalar: S)
[src]
impl<S> MetricSpace for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Metric = S
The metric to be returned by the distance
function.
fn distance2(self, other: Point2<S>) -> S
[src]
fn distance(self, other: Self) -> Self::Metric
[src]
The distance between two values.
impl<S> Div<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Point2<S>
[src]
impl<'a, S> Div<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Point2<S>
[src]
impl<S> AsMut<[S; 2]> for Point2<S>
[src]
impl<S> AsMut<(S, S)> for Point2<S>
[src]
impl<S> SubAssign<Vector2<S>> for Point2<S> where
S: BaseNum + SubAssign<S>,
[src]
S: BaseNum + SubAssign<S>,
fn sub_assign(&mut self, vector: Vector2<S>)
[src]
impl<'a, S> Add<&'a Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Vector2<S>) -> Point2<S>
[src]
impl<'a, 'b, S> Add<&'a Vector2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Vector2<S>) -> Point2<S>
[src]
impl<S> Add<Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: Vector2<S>) -> Point2<S>
[src]
impl<'a, S> Add<Vector2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: Vector2<S>) -> Point2<S>
[src]
impl<S> Clone for Point2<S> where
S: Clone,
[src]
S: Clone,
fn clone(&self) -> Point2<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S> From<[S; 2]> for Point2<S> where
S: Clone,
[src]
S: Clone,
impl<'a, S> From<&'a (S, S)> for &'a Point2<S>
[src]
impl<S> From<(S, S)> for Point2<S>
[src]
impl<'a, S> From<&'a mut (S, S)> for &'a mut Point2<S>
[src]
impl<'a, S> From<&'a mut [S; 2]> for &'a mut Point2<S>
[src]
impl<'a, S> From<&'a [S; 2]> for &'a Point2<S>
[src]
impl<S> Debug for Point2<S> where
S: Debug,
[src]
S: Debug,
impl<S> Copy for Point2<S> where
S: Copy,
[src]
S: Copy,
impl<S> Eq for Point2<S> where
S: Eq,
[src]
S: Eq,
impl<'a, S> Sub<Vector2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Vector2<S>) -> Point2<S>
[src]
impl<'a, S> Sub<&'a Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Point2<S>) -> Vector2<S>
[src]
impl<S> Sub<Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Point2<S>) -> Vector2<S>
[src]
impl<S> Sub<Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Vector2<S>) -> Point2<S>
[src]
impl<'a, S> Sub<&'a Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Vector2<S>) -> Point2<S>
[src]
impl<'a, 'b, S> Sub<&'a Vector2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Vector2<S>) -> Point2<S>
[src]
impl<'a, 'b, S> Sub<&'a Point2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Point2<S>) -> Vector2<S>
[src]
impl<'a, S> Sub<Point2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Point2<S>) -> Vector2<S>
[src]
impl<S> Rem<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Point2<S>
[src]
impl<'a, S> Rem<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Point2<S>
[src]
impl<S> AsRef<[S; 2]> for Point2<S>
[src]
impl<S> AsRef<(S, S)> for Point2<S>
[src]
impl<S> EuclideanSpace for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Scalar = S
The associated scalar over which the space is defined. Read more
type Diff = Vector2<S>
The associated space of displacement vectors.
fn origin() -> Point2<S>
[src]
fn from_vec(v: Vector2<S>) -> Point2<S>
[src]
fn to_vec(self) -> Vector2<S>
[src]
fn dot(self, v: Vector2<S>) -> S
[src]
fn midpoint(self, other: Self) -> Self
[src]
Returns the middle point between two other points. Read more
fn centroid(points: &[Self]) -> Self
[src]
Returns the average position of all points in the slice. Read more
impl<S> Into<(S, S)> for Point2<S>
[src]
impl<S> Into<[S; 2]> for Point2<S>
[src]
impl<S> UlpsEq<Point2<S>> for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn default_max_ulps() -> u32
[src]
fn ulps_eq(
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_ulps: u32
) -> bool
fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<S> AddAssign<Vector2<S>> for Point2<S> where
S: BaseNum + AddAssign<S>,
[src]
S: BaseNum + AddAssign<S>,
fn add_assign(&mut self, vector: Vector2<S>)
[src]
impl<S> Array for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Element = S
fn len() -> usize
[src]
fn from_value(scalar: S) -> Point2<S>
[src]
fn sum(self) -> S where
S: Add<S, Output = S>,
[src]
S: Add<S, Output = S>,
fn product(self) -> S where
S: Mul<S, Output = S>,
[src]
S: Mul<S, Output = S>,
fn is_finite(&self) -> bool where
S: BaseFloat,
[src]
S: BaseFloat,
fn as_ptr(&self) -> *const Self::Element
[src]
Get the pointer to the first element of the array.
fn as_mut_ptr(&mut self) -> *mut Self::Element
[src]
Get a mutable pointer to the first element of the array.
fn swap_elements(&mut self, i: usize, j: usize)
[src]
Swap the elements at indices i
and j
in-place.
impl<S> MulAssign<S> for Point2<S> where
S: BaseNum + MulAssign<S>,
[src]
S: BaseNum + MulAssign<S>,
fn mul_assign(&mut self, scalar: S)
[src]
impl<S> RelativeEq<Point2<S>> for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn default_max_relative() -> <S as AbsDiffEq<S>>::Epsilon
[src]
fn relative_eq(
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
[src]
&self,
other: &Point2<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
impl<S> Hash for Point2<S> where
S: Hash,
[src]
S: Hash,
fn hash<__HS>(&self, state: &mut __HS) where
__HS: Hasher,
[src]
__HS: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<S> Index<RangeTo<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeTo<usize>) -> &'a [S]
[src]
impl<S> Index<Range<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: Range<usize>) -> &'a [S]
[src]
impl<S> Index<RangeFrom<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeFrom<usize>) -> &'a [S]
[src]
impl<S> Index<RangeFull> for Point2<S>
[src]
impl<S> Index<usize> for Point2<S>
[src]
impl<S> IndexMut<Range<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: Range<usize>) -> &'a mut [S]
[src]
impl<S> IndexMut<usize> for Point2<S>
[src]
impl<S> IndexMut<RangeTo<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
[src]
impl<S> IndexMut<RangeFrom<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
[src]
impl<S> IndexMut<RangeFull> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeFull) -> &'a mut [S]
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, Rhs, Output> NumOps for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,