Struct geo::Point [−][src]
pub struct Point<T>(pub Coordinate<T>)
where
T: CoordNum;
A single point in 2D space.
Points can be created using the Point::new
constructor,
the point!
macro, or from a Coordinate
, two-element
tuples, or arrays – see the From
impl section for a
complete list.
Semantics
The interior of the point is itself (a singleton set),
and its boundary is empty. A point is valid if and
only if the Coordinate
is valid.
Examples
use geo_types::{Coordinate, Point}; let p1: Point<f64> = (0., 1.).into(); let c = Coordinate { x: 10., y: 20. }; let p2: Point<f64> = c.into();
Implementations
impl<T> Point<T> where
T: CoordNum,
[src]
T: CoordNum,
pub fn new(x: T, y: T) -> Point<T>
[src]
Creates a new point.
Examples
use geo_types::Point; let p = Point::new(1.234, 2.345); assert_eq!(p.x(), 1.234); assert_eq!(p.y(), 2.345);
pub fn x(self) -> T
[src]
Returns the x/horizontal component of the point.
Examples
use geo_types::Point; let p = Point::new(1.234, 2.345); assert_eq!(p.x(), 1.234);
pub fn set_x(&mut self, x: T) -> &mut Point<T>
[src]
Sets the x/horizontal component of the point.
Examples
use geo_types::Point; let mut p = Point::new(1.234, 2.345); p.set_x(9.876); assert_eq!(p.x(), 9.876);
pub fn y(self) -> T
[src]
Returns the y/vertical component of the point.
Examples
use geo_types::Point; let p = Point::new(1.234, 2.345); assert_eq!(p.y(), 2.345);
pub fn set_y(&mut self, y: T) -> &mut Point<T>
[src]
Sets the y/vertical component of the point.
Examples
use geo_types::Point; let mut p = Point::new(1.234, 2.345); p.set_y(9.876); assert_eq!(p.y(), 9.876);
pub fn x_y(self) -> (T, T)
[src]
Returns a tuple that contains the x/horizontal & y/vertical component of the point.
Examples
use geo_types::Point; let mut p = Point::new(1.234, 2.345); let (x, y) = p.x_y(); assert_eq!(y, 2.345); assert_eq!(x, 1.234);
pub fn lng(self) -> T
[src]
Returns the longitude/horizontal component of the point.
Examples
use geo_types::Point; let p = Point::new(1.234, 2.345); assert_eq!(p.lng(), 1.234);
pub fn set_lng(&mut self, lng: T) -> &mut Point<T>
[src]
Sets the longitude/horizontal component of the point.
Examples
use geo_types::Point; let mut p = Point::new(1.234, 2.345); p.set_lng(9.876); assert_eq!(p.lng(), 9.876);
pub fn lat(self) -> T
[src]
Returns the latitude/vertical component of the point.
Examples
use geo_types::Point; let p = Point::new(1.234, 2.345); assert_eq!(p.lat(), 2.345);
pub fn set_lat(&mut self, lat: T) -> &mut Point<T>
[src]
Sets the latitude/vertical component of the point.
Examples
use geo_types::Point; let mut p = Point::new(1.234, 2.345); p.set_lat(9.876); assert_eq!(p.lat(), 9.876);
impl<T> Point<T> where
T: CoordNum,
[src]
T: CoordNum,
pub fn dot(self, other: Point<T>) -> T
[src]
Returns the dot product of the two points:
dot = x1 * x2 + y1 * y2
Examples
use geo_types::{Coordinate, Point}; let point = Point(Coordinate { x: 1.5, y: 0.5 }); let dot = point.dot(Point(Coordinate { x: 2.0, y: 4.5 })); assert_eq!(dot, 5.25);
pub fn cross_prod(self, point_b: Point<T>, point_c: Point<T>) -> T
[src]
Returns the cross product of 3 points. A positive value implies
self
→ point_b
→ point_c
is counter-clockwise, negative implies
clockwise.
Examples
use geo_types::{Coordinate, Point}; let point_a = Point(Coordinate { x: 1., y: 2. }); let point_b = Point(Coordinate { x: 3., y: 5. }); let point_c = Point(Coordinate { x: 7., y: 12. }); let cross = point_a.cross_prod(point_b, point_c); assert_eq!(cross, 2.0)
impl<T> Point<T> where
T: CoordFloat,
[src]
T: CoordFloat,
pub fn to_degrees(self) -> Point<T>
[src]
Converts the (x,y) components of Point to degrees
Example
use geo_types::Point; let p = Point::new(1.234, 2.345); let (x, y): (f32, f32) = p.to_degrees().x_y(); assert_eq!(x.round(), 71.0); assert_eq!(y.round(), 134.0);
pub fn to_radians(self) -> Point<T>
[src]
Converts the (x,y) components of Point to radians
Example
use geo_types::Point; let p = Point::new(180.0, 341.5); let (x, y): (f32, f32) = p.to_radians().x_y(); assert_eq!(x.round(), 3.0); assert_eq!(y.round(), 6.0);
Trait Implementations
impl<T> AbsDiffEq<Point<T>> for Point<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
[src]
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
<T as AbsDiffEq<T>>::Epsilon: Copy,
type Epsilon = <T as AbsDiffEq<T>>::Epsilon
Used for specifying relative comparisons.
pub fn default_epsilon() -> <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
[src]
pub fn abs_diff_eq(
&self,
other: &Point<T>,
epsilon: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
) -> bool
[src]
&self,
other: &Point<T>,
epsilon: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
) -> bool
Equality assertion with an absolute limit.
Examples
use geo_types::Point; let a = Point::new(2.0, 3.0); let b = Point::new(2.0, 3.0000001); approx::assert_relative_eq!(a, b, epsilon=0.1)
pub fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
impl<T> Add<Point<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
type Output = Point<T>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Point<T>) -> Point<T>
[src]
Add a point to the given point.
Examples
use geo_types::Point; let p = Point::new(1.25, 2.5) + Point::new(1.5, 2.5); assert_eq!(p.x(), 2.75); assert_eq!(p.y(), 5.0);
impl<T> Area<T> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Bearing<T> for Point<T> where
T: CoordFloat,
[src]
T: CoordFloat,
impl<T> BoundingRect<T> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
type Output = Rect<T>
fn bounding_rect(&self) -> Self::Output
[src]
Return the bounding rectangle for a Point
. It will have zero width
and zero height.
impl<T> Centroid for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
impl<T> Clone for Point<T> where
T: Clone + CoordNum,
[src]
T: Clone + CoordNum,
impl<'a, F, C> ClosestPoint<F, Point<F>> for &'a C where
C: ClosestPoint<F>,
F: GeoFloat,
[src]
C: ClosestPoint<F>,
F: GeoFloat,
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for Point<F>
[src]
fn closest_point(&self, p: &Self) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for Line<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for LineString<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for Polygon<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPolygon<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiPoint<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for MultiLineString<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
impl<T> Contains<Coordinate<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
fn contains(&self, coord: &Coordinate<T>) -> bool
[src]
impl<T> Contains<Point<T>> for Geometry<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for GeometryCollection<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for Line<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for LineString<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> Contains<Point<T>> for Polygon<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for MultiPolygon<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> Contains<Point<T>> for Rect<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> Contains<Point<T>> for Triangle<T> where
T: GeoNum,
[src]
T: GeoNum,
impl<T> CoordinatePosition for Point<T> where
T: GeoNum,
[src]
T: GeoNum,
type Scalar = T
fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
fn coordinate_position(&self, coord: &Coordinate<Self::Scalar>) -> CoordPos
[src]
impl<'a, T: CoordNum> CoordsIter<'a> for Point<T>
[src]
type Iter = Once<Coordinate<T>>
type ExteriorIter = Self::Iter
type Scalar = T
fn coords_iter(&'a self) -> Self::Iter
[src]
fn coords_count(&'a self) -> usize
[src]
Return the number of coordinates in the Point
.
fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
[src]
impl<T> Copy for Point<T> where
T: Copy + CoordNum,
[src]
T: Copy + CoordNum,
impl<T> Debug for Point<T> where
T: Debug + CoordNum,
[src]
T: Debug + CoordNum,
impl<T> Default for Point<T> where
T: Default + CoordNum,
[src]
T: Default + CoordNum,
impl<T> Div<T> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
type Output = Point<T>
The resulting type after applying the /
operator.
pub fn div(self, rhs: T) -> Point<T>
[src]
Scaler division of a point
Examples
use geo_types::Point; let p = Point::new(2.0, 3.0) / 2.0; assert_eq!(p.x(), 1.0); assert_eq!(p.y(), 1.5);
impl<T> Eq for Point<T> where
T: Eq + CoordNum,
[src]
T: Eq + CoordNum,
impl<T> EuclideanDistance<T, Line<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, line: &Line<T>) -> T
[src]
Minimum distance from a Line to a Point
impl<T> EuclideanDistance<T, LineString<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, linestring: &LineString<T>) -> T
[src]
Minimum distance from a Point to a LineString
impl<T> EuclideanDistance<T, MultiLineString<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, mls: &MultiLineString<T>) -> T
[src]
Minimum distance from a Point to a MultiLineString
impl<T> EuclideanDistance<T, MultiPoint<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, points: &MultiPoint<T>) -> T
[src]
Minimum distance from a Point to a MultiPoint
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
[src]
Minimum distance from a Point to a MultiPolygon
impl<T> EuclideanDistance<T, Point<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, p: &Point<T>) -> T
[src]
Minimum distance between two Points
impl<T> EuclideanDistance<T, Point<T>> for MultiPoint<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a MultiPoint to a Point
impl<T> EuclideanDistance<T, Point<T>> for Line<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a Line to a Point
impl<T> EuclideanDistance<T, Point<T>> for LineString<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a LineString to a Point
impl<T> EuclideanDistance<T, Point<T>> for MultiLineString<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a MultiLineString to a Point
impl<T> EuclideanDistance<T, Point<T>> for Polygon<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a Polygon to a Point
impl<T> EuclideanDistance<T, Point<T>> for MultiPolygon<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
Minimum distance from a MultiPolygon to a Point
impl<T> EuclideanDistance<T, Point<T>> for Triangle<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, point: &Point<T>) -> T
[src]
impl<T> EuclideanDistance<T, Polygon<T>> for Point<T> where
T: GeoFloat,
[src]
T: GeoFloat,
fn euclidean_distance(&self, polygon: &Polygon<T>) -> T
[src]
Minimum distance from a Point to a Polygon
impl<T> From<[T; 2]> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> From<(T, T)> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> From<Coordinate<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
pub fn from(x: Coordinate<T>) -> Point<T>
[src]
impl<T> From<Point<T>> for Coordinate<T> where
T: CoordNum,
[src]
T: CoordNum,
pub fn from(point: Point<T>) -> Coordinate<T>
[src]
impl<T> From<Point<T>> for Geometry<T> where
T: CoordNum,
[src]
T: CoordNum,
impl GeodesicDistance<f64, Point<f64>> for Point<f64>
[src]
fn geodesic_distance(&self, rhs: &Point<f64>) -> f64
[src]
impl GeodesicIntermediate<f64> for Point<f64>
[src]
fn geodesic_intermediate(&self, other: &Point<f64>, f: f64) -> Point<f64>
[src]
fn geodesic_intermediate_fill(
&self,
other: &Point<f64>,
max_dist: f64,
include_ends: bool
) -> Vec<Point<f64>>
[src]
&self,
other: &Point<f64>,
max_dist: f64,
include_ends: bool
) -> Vec<Point<f64>>
impl<C: CoordNum> HasDimensions for Point<C>
[src]
fn is_empty(&self) -> bool
[src]
fn dimensions(&self) -> Dimensions
[src]
fn boundary_dimensions(&self) -> Dimensions
[src]
impl<T> Hash for Point<T> where
T: Hash + CoordNum,
[src]
T: Hash + CoordNum,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> HaversineDestination<T> for Point<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn haversine_destination(&self, bearing: T, distance: T) -> Point<T>
[src]
impl<T> HaversineDistance<T, Point<T>> for Point<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn haversine_distance(&self, rhs: &Point<T>) -> T
[src]
impl<T> HaversineIntermediate<T> for Point<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn haversine_intermediate(&self, other: &Point<T>, f: T) -> Point<T>
[src]
fn haversine_intermediate_fill(
&self,
other: &Point<T>,
max_dist: T,
include_ends: bool
) -> Vec<Point<T>>
[src]
&self,
other: &Point<T>,
max_dist: T,
include_ends: bool
) -> Vec<Point<T>>
impl<T, G> Intersects<G> for Point<T> where
T: CoordNum,
Coordinate<T>: Intersects<G>,
[src]
T: CoordNum,
Coordinate<T>: Intersects<G>,
fn intersects(&self, rhs: &G) -> bool
[src]
impl<T> Intersects<MultiPolygon<T>> for Point<T> where
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
[src]
MultiPolygon<T>: Intersects<Point<T>>,
T: CoordNum,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
[src]
impl<T> Intersects<Point<T>> for Coordinate<T> where
T: CoordNum,
[src]
T: CoordNum,
fn intersects(&self, rhs: &Point<T>) -> bool
[src]
impl<T> Intersects<Point<T>> for Line<T> where
Point<T>: Intersects<Line<T>>,
T: CoordNum,
[src]
Point<T>: Intersects<Line<T>>,
T: CoordNum,
fn intersects(&self, rhs: &Point<T>) -> bool
[src]
impl<T> Intersects<Point<T>> for Polygon<T> where
Point<T>: Intersects<Polygon<T>>,
T: CoordNum,
[src]
Point<T>: Intersects<Polygon<T>>,
T: CoordNum,
fn intersects(&self, rhs: &Point<T>) -> bool
[src]
impl<T> Intersects<Point<T>> for Rect<T> where
Point<T>: Intersects<Rect<T>>,
T: CoordNum,
[src]
Point<T>: Intersects<Rect<T>>,
T: CoordNum,
fn intersects(&self, rhs: &Point<T>) -> bool
[src]
impl<T> LineLocatePoint<T, Point<T>> for Line<T> where
T: CoordFloat,
[src]
T: CoordFloat,
type Output = Option<T>
type Rhs = Point<T>
fn line_locate_point(&self, p: &Self::Rhs) -> Self::Output
[src]
impl<T> LineLocatePoint<T, Point<T>> for LineString<T> where
T: CoordFloat + AddAssign,
Line<T>: EuclideanDistance<T, Point<T>> + EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
[src]
T: CoordFloat + AddAssign,
Line<T>: EuclideanDistance<T, Point<T>> + EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
type Output = Option<T>
type Rhs = Point<T>
fn line_locate_point(&self, p: &Self::Rhs) -> Self::Output
[src]
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for Point<T>
[src]
type Output = Point<NT>
fn map_coords(&self, func: impl Fn(&(T, T)) -> (NT, NT) + Copy) -> Self::Output
[src]
impl<T: CoordNum> MapCoordsInplace<T> for Point<T>
[src]
impl<T> Mul<T> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
type Output = Point<T>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: T) -> Point<T>
[src]
Scaler multiplication of a point
Examples
use geo_types::Point; let p = Point::new(2.0, 3.0) * 2.0; assert_eq!(p.x(), 4.0); assert_eq!(p.y(), 6.0);
impl<T> Neg for Point<T> where
T: CoordNum + Neg<Output = T>,
[src]
T: CoordNum + Neg<Output = T>,
type Output = Point<T>
The resulting type after applying the -
operator.
pub fn neg(self) -> Point<T>
[src]
Returns a point with the x and y components negated.
Examples
use geo_types::Point; let p = -Point::new(-1.25, 2.5); assert_eq!(p.x(), 1.25); assert_eq!(p.y(), -2.5);
impl<T> PartialEq<Point<T>> for Point<T> where
T: PartialEq<T> + CoordNum,
[src]
T: PartialEq<T> + CoordNum,
impl<T> Point for Point<T> where
T: Float + RTreeNum,
[src]
T: Float + RTreeNum,
type Scalar = T
The number type used by this point type.
pub const DIMENSIONS: usize
[src]
pub fn generate(
generator: impl Fn(usize) -> <Point<T> as Point>::Scalar
) -> Point<T>
[src]
generator: impl Fn(usize) -> <Point<T> as Point>::Scalar
) -> Point<T>
pub fn nth(&self, index: usize) -> <Point<T> as Point>::Scalar
[src]
pub fn nth_mut(&mut self, index: usize) -> &mut <Point<T> as Point>::Scalar
[src]
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Point<F>
[src]
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Line<F>> for Point<F>
[src]
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, LineString<F>> for Point<F>
[src]
fn relate(&self, other: &LineString<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, MultiLineString<F>> for Point<F>
[src]
fn relate(&self, other: &MultiLineString<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, MultiPoint<F>> for Point<F>
[src]
fn relate(&self, other: &MultiPoint<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Point<F>
[src]
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for Point<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for Line<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for LineString<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for Polygon<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for MultiPoint<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for MultiLineString<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for MultiPolygon<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for Rect<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for Triangle<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Point<F>> for GeometryCollection<F>
[src]
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Polygon<F>> for Point<F>
[src]
fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Rect<F>> for Point<F>
[src]
fn relate(&self, other: &Rect<F>) -> IntersectionMatrix
[src]
impl<F: GeoFloat> Relate<F, Triangle<F>> for Point<F>
[src]
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
[src]
impl<T> RelativeEq<Point<T>> for Point<T> where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
[src]
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
pub fn default_max_relative() -> <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
[src]
pub fn relative_eq(
&self,
other: &Point<T>,
epsilon: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon,
max_relative: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
) -> bool
[src]
&self,
other: &Point<T>,
epsilon: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon,
max_relative: <Point<T> as AbsDiffEq<Point<T>>>::Epsilon
) -> bool
Equality assertion within a relative limit.
Examples
use geo_types::Point; let a = Point::new(2.0, 3.0); let b = Point::new(2.0, 3.01); approx::assert_relative_eq!(a, b, max_relative=0.1)
pub 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
impl<T> Rotate<T> for Point<T> where
T: CoordFloat,
[src]
T: CoordFloat,
fn rotate(&self, _angle: T) -> Self
[src]
Rotate the Point about itself by the given number of degrees This operation leaves the point coordinates unchanged
impl<T> StructuralEq for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> StructuralPartialEq for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
impl<T> Sub<Point<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
type Output = Point<T>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Point<T>) -> Point<T>
[src]
Subtract a point from the given point.
Examples
use geo_types::Point; let p = Point::new(1.25, 3.0) - Point::new(1.5, 2.5); assert_eq!(p.x(), -0.25); assert_eq!(p.y(), 0.5);
impl<T> TryFrom<Geometry<T>> for Point<T> where
T: CoordNum,
[src]
T: CoordNum,
Convert a Geometry enum into its inner type.
Fails if the enum case does not match the type you are trying to convert it to.
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(
geom: Geometry<T>
) -> Result<Point<T>, <Point<T> as TryFrom<Geometry<T>>>::Error>
[src]
geom: Geometry<T>
) -> Result<Point<T>, <Point<T> as TryFrom<Geometry<T>>>::Error>
impl<T: CoordNum, NT: CoordNum> TryMapCoords<T, NT> for Point<T>
[src]
type Output = Point<NT>
fn try_map_coords(
&self,
func: impl Fn(&(T, T)) -> Result<(NT, NT), Box<dyn Error + Send + Sync>>
) -> Result<Self::Output, Box<dyn Error + Send + Sync>>
[src]
&self,
func: impl Fn(&(T, T)) -> Result<(NT, NT), Box<dyn Error + Send + Sync>>
) -> Result<Self::Output, Box<dyn Error + Send + Sync>>
impl<T> VincentyDistance<T, Point<T>> for Point<T> where
T: CoordFloat + FromPrimitive,
[src]
T: CoordFloat + FromPrimitive,
fn vincenty_distance(&self, rhs: &Point<T>) -> Result<T, FailedToConvergeError>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Point<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Point<T> where
T: Send,
T: Send,
impl<T> Sync for Point<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Point<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Point<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T, G> Extremes<'a, T> for G where
T: CoordNum,
G: CoordsIter<'a, Scalar = T>,
[src]
T: CoordNum,
G: CoordsIter<'a, Scalar = T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<P> PointDistance for P where
P: Point,
[src]
P: Point,
pub fn distance_2(&self, point: &P) -> <P as Point>::Scalar
[src]
pub fn contains_point(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point
) -> bool
[src]
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point
) -> bool
pub fn distance_2_if_less_or_equal(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point,
max_distance_2: <<<P as RTreeObject>::Envelope as Envelope>::Point as Point>::Scalar
) -> Option<<P as Point>::Scalar>
[src]
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point,
max_distance_2: <<<P as RTreeObject>::Envelope as Envelope>::Point as Point>::Scalar
) -> Option<<P as Point>::Scalar>
impl<P> RTreeObject for P where
P: Point,
[src]
P: Point,
type Envelope = AABB<P>
The object’s envelope type. Usually, AABB will be the right choice. This type also defines the objects dimensionality. Read more
pub fn envelope(&self) -> AABB<P>
[src]
impl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
[src]
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
pub fn rotate_around_point(&Self, T, Point<T>) -> G
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
[src]
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,