SpherePoint

Trait SpherePoint 

Source
pub trait SpherePoint: GridPoint {
    // Required methods
    fn from_geographic(latitude: f64, longitude: f64) -> Self;
    fn latitude(&self) -> f64;
    fn longitude(&self) -> f64;

    // Provided method
    fn sphere_coordinates(&self) -> (f64, f64) { ... }
}
Expand description

A point on a spherical grid.

Required Methods§

Source

fn from_geographic(latitude: f64, longitude: f64) -> Self

Gets a sphere point for the specified geographic coordinates.

  • latitude - The latitude of the point in radians where 0 is the equator.
  • longitude - The longitude of the point in radians.
Source

fn latitude(&self) -> f64

Gets the latitude of this point.

Source

fn longitude(&self) -> f64

Gets the longitude of this point.

Provided Methods§

Source

fn sphere_coordinates(&self) -> (f64, f64)

Returns a coordinate containing the latitude and longitude of this point. This returns a point with the X component being the longitude and the Y component being the latitude.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const S: usize> SpherePoint for CubeSpherePoint<S>

Source§

impl<const W: usize, const H: usize> SpherePoint for RectangleSpherePoint<W, H>