# Struct cgmath::Point1
[−]
[src]

pub struct Point1<S> { pub x: S, }

A point in 1-dimensional space.

This type is marked as `#[repr(C, packed)]`

.

## Fields

`x: S`

## Methods

`impl<S: BaseNum> Point1<S>`

[src]

## Trait Implementations

`impl<S: Hash> Hash for Point1<S>`

[src]

`fn hash<__HS: Hasher>(&self, __arg_0: &mut __HS)`

Feeds this value into the state given, updating the hasher as necessary.

`fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher`

1.3.0

Feeds a slice of this type into the state provided.

`impl<S: Clone> Clone for Point1<S>`

[src]

`fn clone(&self) -> Point1<S>`

Returns a copy of the value. Read more

`fn clone_from(&mut self, source: &Self)`

1.0.0

Performs copy-assignment from `source`

. Read more

`impl<S: Copy> Copy for Point1<S>`

[src]

`impl<S: Eq> Eq for Point1<S>`

[src]

`impl<S: PartialEq> PartialEq for Point1<S>`

[src]

`fn eq(&self, __arg_0: &Point1<S>) -> bool`

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, __arg_0: &Point1<S>) -> bool`

This method tests for `!=`

.

`impl<S: Decodable> Decodable for Point1<S>`

[src]

`impl<S: Encodable> Encodable for Point1<S>`

[src]

`impl<S: BaseNum> Array for Point1<S>`

[src]

`type Element = S`

`fn from_value(scalar: S) -> Point1<S>`

Construct a vector from a single value, replicating it. Read more

`fn sum(self) -> S where S: Add<Output=S>`

The sum of the elements of the array.

`fn product(self) -> S where S: Mul<Output=S>`

The product of the elements of the array.

`fn min(self) -> S where S: PartialOrd`

The minimum element of the array.

`fn max(self) -> S where S: PartialOrd`

The maximum element of the array.

`fn as_ptr(&self) -> *const Self::Element`

Get the pointer to the first element of the array.

`fn as_mut_ptr(&mut self) -> *mut Self::Element`

Get a mutable pointer to the first element of the array.

`fn swap_elements(&mut self, i: usize, j: usize)`

Swap the elements at indices `i`

and `j`

in-place.

`impl<S: BaseFloat> MetricSpace for Point1<S>`

[src]

`type Metric = S`

The metric to be returned by the `distance`

function.

`fn distance2(self, other: Self) -> S`

Returns the squared distance. Read more

`fn distance(self, other: Self) -> Self::Metric`

The distance between two values.

`impl<S: BaseNum> EuclideanSpace for Point1<S>`

[src]

`type Scalar = S`

The associated scalar over which the space is defined. Read more

`type Diff = Vector1<S>`

The associated space of displacement vectors.

`fn origin() -> Point1<S>`

The point at the origin of the Euclidean space.

`fn from_vec(v: Vector1<S>) -> Point1<S>`

Convert a displacement vector to a point. Read more

`fn to_vec(self) -> Vector1<S>`

Convert a point to a displacement vector. Read more

`fn dot(self, v: Vector1<S>) -> S`

This is a weird one, but its useful for plane calculations.

`fn midpoint(self, other: Self) -> Self`

Returns the middle point between two other points. Read more

`fn centroid(points: &[Self]) -> Self`

Returns the average position of all points in the slice. Read more

`impl<S: BaseFloat> ApproxEq for Point1<S>`

[src]

`type Epsilon = S`

`fn approx_eq_eps(&self, other: &Point1<S>, epsilon: &S) -> bool`

`fn approx_epsilon() -> Self::Epsilon`

`fn approx_eq(&self, other: &Self) -> bool`

`impl<S: BaseNum> Add<Vector1<S>> for Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `+`

operator

`fn add(self, other: Vector1<S>) -> Point1<S>`

The method for the `+`

operator

`impl<'a, S: BaseNum> Add<&'a Vector1<S>> for Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `+`

operator

`fn add(self, other: &'a Vector1<S>) -> Point1<S>`

The method for the `+`

operator

`impl<'a, S: BaseNum> Add<Vector1<S>> for &'a Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `+`

operator

`fn add(self, other: Vector1<S>) -> Point1<S>`

The method for the `+`

operator

`impl<'a, 'b, S: BaseNum> Add<&'a Vector1<S>> for &'b Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `+`

operator

`fn add(self, other: &'a Vector1<S>) -> Point1<S>`

The method for the `+`

operator

`impl<S: BaseNum + AddAssign<S>> AddAssign<Vector1<S>> for Point1<S>`

[src]

`fn add_assign(&mut self, vector: Vector1<S>)`

The method for the `+=`

operator

`impl<S: BaseNum> Sub<Point1<S>> for Point1<S>`

[src]

`type Output = Vector1<S>`

The resulting type after applying the `-`

operator

`fn sub(self, other: Point1<S>) -> Vector1<S>`

The method for the `-`

operator

`impl<'a, S: BaseNum> Sub<&'a Point1<S>> for Point1<S>`

[src]

`type Output = Vector1<S>`

The resulting type after applying the `-`

operator

`fn sub(self, other: &'a Point1<S>) -> Vector1<S>`

The method for the `-`

operator

`impl<'a, S: BaseNum> Sub<Point1<S>> for &'a Point1<S>`

[src]

`type Output = Vector1<S>`

The resulting type after applying the `-`

operator

`fn sub(self, other: Point1<S>) -> Vector1<S>`

The method for the `-`

operator

`impl<'a, 'b, S: BaseNum> Sub<&'a Point1<S>> for &'b Point1<S>`

[src]

`type Output = Vector1<S>`

The resulting type after applying the `-`

operator

`fn sub(self, other: &'a Point1<S>) -> Vector1<S>`

The method for the `-`

operator

`impl<S: BaseNum> Mul<S> for Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `*`

operator

`fn mul(self, other: S) -> Point1<S>`

The method for the `*`

operator

`impl<'a, S: BaseNum> Mul<S> for &'a Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `*`

operator

`fn mul(self, other: S) -> Point1<S>`

The method for the `*`

operator

`impl<S: BaseNum> Div<S> for Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `/`

operator

`fn div(self, other: S) -> Point1<S>`

The method for the `/`

operator

`impl<'a, S: BaseNum> Div<S> for &'a Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `/`

operator

`fn div(self, other: S) -> Point1<S>`

The method for the `/`

operator

`impl<S: BaseNum> Rem<S> for Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `%`

operator

`fn rem(self, other: S) -> Point1<S>`

The method for the `%`

operator

`impl<'a, S: BaseNum> Rem<S> for &'a Point1<S>`

[src]

`type Output = Point1<S>`

The resulting type after applying the `%`

operator

`fn rem(self, other: S) -> Point1<S>`

The method for the `%`

operator

`impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Point1<S>`

[src]

`fn mul_assign(&mut self, scalar: S)`

The method for the `*=`

operator

`impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Point1<S>`

[src]

`fn div_assign(&mut self, scalar: S)`

The method for the `/=`

operator

`impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Point1<S>`

[src]

`fn rem_assign(&mut self, scalar: S)`

The method for the `%=`

operator

`impl<S> Index<usize> for Point1<S>`

[src]

`type Output = S`

The returned type after indexing

`fn index<'a>(&'a self, i: usize) -> &'a S`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> IndexMut<usize> for Point1<S>`

[src]

`fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> Index<Range<usize>> for Point1<S>`

[src]

`type Output = [S]`

The returned type after indexing

`fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> IndexMut<Range<usize>> for Point1<S>`

[src]

`fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> Index<RangeTo<usize>> for Point1<S>`

[src]

`type Output = [S]`

The returned type after indexing

`fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> IndexMut<RangeTo<usize>> for Point1<S>`

[src]

`fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> Index<RangeFrom<usize>> for Point1<S>`

[src]

`type Output = [S]`

The returned type after indexing

`fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> IndexMut<RangeFrom<usize>> for Point1<S>`

[src]

`fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> Index<RangeFull> for Point1<S>`

[src]

`type Output = [S]`

The returned type after indexing

`fn index<'a>(&'a self, i: RangeFull) -> &'a [S]`

The method for the indexing (`Foo[Bar]`

) operation

`impl<S> IndexMut<RangeFull> for Point1<S>`

[src]

`fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]`

The method for the indexing (`Foo[Bar]`

) operation