irox_carto/
proj.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: MIT
// Copyright 2023 IROX Contributors

//!
//! Map Projection Traits

use crate::coordinate::{CartesianCoordinate, EllipticalCoordinate};

///
/// Allows a projection from Elliptical to Cartesian coordinates
pub trait Projection {
    /// Returns the center elliptical coordinate of this projection
    fn get_center_coords(&self) -> &EllipticalCoordinate;

    /// Projects the elliptical coordinate to an equivalent cartesian coordinate
    fn project_to_cartesian(&self, coord: &EllipticalCoordinate) -> CartesianCoordinate;

    /// Projects the cartesian coordinate to an equivalent elliptical coordinate
    fn project_to_elliptical(&self, coord: &CartesianCoordinate) -> EllipticalCoordinate;
}