pub struct Point<T, const D: usize, Cs = Cartesian>where
T: CoordinateScalar,
Cs: CoordinateSystem,{ /* private fields */ }Expand description
Default Point — a [T; D] array plus a phantom CS tag.
Mirrors boost::geometry::model::point<CoordinateType, DimensionCount, CoordinateSystem> from boost/geometry/geometries/point.hpp. The
#[repr(transparent)] annotation guarantees the in-memory layout
matches the underlying [T; D], so callers can safely treat the
point as an array of coordinates when interfacing with FFI or SIMD
code — the same invariant Boost relies on for its
m_values[DimensionCount] member.
Implementations§
Source§impl<T, Cs> Point<T, 1, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
impl<T, Cs> Point<T, 1, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Source§impl<T, Cs> Point<T, 2, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
impl<T, Cs> Point<T, 2, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Sourcepub const fn new(v0: T, v1: T) -> Point<T, 2, Cs>
pub const fn new(v0: T, v1: T) -> Point<T, 2, Cs>
Construct a 2-D point.
Mirrors the two-argument point(v0, v1) constructor at
boost/geometry/geometries/point.hpp:151-167.
Sourcepub const fn x(&self) -> T
pub const fn x(&self) -> T
Return the x ordinate.
Mirrors model::d2::point_xy::x() const from
geometries/point_xy.hpp:67-68.
Sourcepub const fn y(&self) -> T
pub const fn y(&self) -> T
Return the y ordinate.
Mirrors model::d2::point_xy::y() const from
geometries/point_xy.hpp:71-72.
Source§impl<T, Cs> Point<T, 3, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
impl<T, Cs> Point<T, 3, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Sourcepub const fn new(v0: T, v1: T, v2: T) -> Point<T, 3, Cs>
pub const fn new(v0: T, v1: T, v2: T) -> Point<T, 3, Cs>
Construct a 3-D point.
Mirrors the three-argument point(v0, v1, v2) constructor at
boost/geometry/geometries/point.hpp:169-185.
Sourcepub const fn x(&self) -> T
pub const fn x(&self) -> T
Return the x ordinate.
Mirrors model::d3::point_xyz::x() const from
geometries/point_xyz.hpp:55-56.
Sourcepub const fn y(&self) -> T
pub const fn y(&self) -> T
Return the y ordinate.
Mirrors model::d3::point_xyz::y() const from
geometries/point_xyz.hpp:59-60.
Sourcepub const fn z(&self) -> T
pub const fn z(&self) -> T
Return the z ordinate.
Mirrors model::d3::point_xyz::z() const from
geometries/point_xyz.hpp:63-64.
Sourcepub fn set_x(&mut self, value: T)
pub fn set_x(&mut self, value: T)
Set the x ordinate.
Mirrors the setter overload model::d3::point_xyz::x(v) from
geometries/point_xyz.hpp:67-68. Rust uses a distinct name because
it has no inherent-method overloading.
Trait Implementations§
Source§impl<T, const D: usize, Cs> ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>> for CartesianClosestPointswhere
T: CoordinateScalar,
Cs: CoordinateSystem,
<Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
Point<T, D, Cs>: PointMut + Default + Copy,
impl<T, const D: usize, Cs> ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>> for CartesianClosestPointswhere
T: CoordinateScalar,
Cs: CoordinateSystem,
<Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
Point<T, D, Cs>: PointMut + Default + Copy,
Source§fn closest_points(
&self,
a: &Point<T, D, Cs>,
b: &Point<T, D, Cs>,
) -> (<CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out, <CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out)
fn closest_points( &self, a: &Point<T, D, Cs>, b: &Point<T, D, Cs>, ) -> (<CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out, <CartesianClosestPoints as ClosestPointsStrategy<Point<T, D, Cs>, Point<T, D, Cs>>>::Out)
(pa, pb) where pa lies on a, pb lies on b, and
the distance |pa − pb| is minimal over the two geometries. Read moreimpl<T, const D: usize, Cs> Copy for Point<T, D, Cs>
Source§impl<T, const D: usize, Cs> Default for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
impl<T, const D: usize, Cs> Default for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Source§impl<'de, T, const D: usize, Cs> Deserialize<'de> for Point<T, D, Cs>
Available on crate feature serde only.
impl<'de, T, const D: usize, Cs> Deserialize<'de> for Point<T, D, Cs>
serde only.Source§fn deserialize<De>(
deserializer: De,
) -> Result<Point<T, D, Cs>, <De as Deserializer<'de>>::Error>where
De: Deserializer<'de>,
fn deserialize<De>(
deserializer: De,
) -> Result<Point<T, D, Cs>, <De as Deserializer<'de>>::Error>where
De: Deserializer<'de>,
impl<T, const D: usize, Cs> Eq for Point<T, D, Cs>
Source§impl<T, const D: usize, Cs> Geometry for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Tag this concrete type as a Point. Mirrors the
traits::tag<model::point<...>> specialisation at
boost/geometry/geometries/point.hpp:241-244.
impl<T, const D: usize, Cs> Geometry for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Tag this concrete type as a Point. Mirrors the
traits::tag<model::point<...>> specialisation at
boost/geometry/geometries/point.hpp:241-244.
Source§impl<T, const D: usize, Cs> Point for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Wire the Point concept up. Collapses the four trait specialisations
at boost/geometry/geometries/point.hpp:246-299
(coordinate_type, coordinate_system, dimension, access)
into one Rust impl.
impl<T, const D: usize, Cs> Point for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Wire the Point concept up. Collapses the four trait specialisations
at boost/geometry/geometries/point.hpp:246-299
(coordinate_type, coordinate_system, dimension, access)
into one Rust impl.
Source§impl<T, const D: usize, Cs> PointMut for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
impl<T, const D: usize, Cs> PointMut for Point<T, D, Cs>where
T: CoordinateScalar,
Cs: CoordinateSystem,
Source§impl<A, const D: usize, OldCs, T, Cs> RebindGeometry<T, Cs> for Point<A, D, OldCs>
impl<A, const D: usize, OldCs, T, Cs> RebindGeometry<T, Cs> for Point<A, D, OldCs>
Source§impl<T, const D: usize, Cs> Serialize for Point<T, D, Cs>
Available on crate feature serde only.
impl<T, const D: usize, Cs> Serialize for Point<T, D, Cs>
serde only.