FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    OrthographicProjector

    struct · ferroui-livecharts · v0.5.0

    struct OrthographicProjector
    

    Projects longitude and latitude on a globe facing the centre coordinate. The far side of the globe is not visible.

    View source

    Members

    PREFERRED_RATIO

    const PREFERRED_RATIO: [f64; 2]
    

    The aspect ratio of a circular globe.

    Source

    new

    fn new(map_width: f64, map_height: f64, offset_x: f64, offset_y: f64, center_lon: f64, center_lat: f64) -> Self
    

    A globe in the map area of the given size at the given offset, facing center_lon and center_lat (degrees). Its radius is half of the smaller side of the area.

    Source

    map_width

    fn map_width(self: &Self) -> f64
    

    Source

    map_height

    fn map_height(self: &Self) -> f64
    

    Source

    x_offset

    fn x_offset(self: &Self) -> f64
    

    Source

    y_offset

    fn y_offset(self: &Self) -> f64
    

    Source

    center_longitude

    fn center_longitude(self: &Self) -> f64
    

    The longitude the globe faces.

    Source

    center_latitude

    fn center_latitude(self: &Self) -> f64
    

    The latitude the globe faces.

    Source

    radius

    fn radius(self: &Self) -> f64
    

    The radius of the globe on the screen.

    Source

    screen_center_x

    fn screen_center_x(self: &Self) -> f64
    

    The screen position of the centre of the globe.

    Source

    screen_center_y

    fn screen_center_y(self: &Self) -> f64
    

    Source

    is_visible

    fn is_visible(self: &Self, longitude: f64, latitude: f64) -> bool
    

    Whether the coordinate is on the near hemisphere: the cosine of its angular distance from the centre is positive.

    Source

    to_map

    fn to_map(self: &Self, longitude: f64, latitude: f64) -> Point
    

    Source

    to_coordinates

    fn to_coordinates(self: &Self, screen: Point) -> Option<(f64, f64)>
    

    The inverse orthographic projection (Snyder, Map Projections, USGS): only the near hemisphere is recoverable, and a position outside the disc has no coordinate.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.