# OrthographicProjector

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/geo/struct-orthographicprojector/

**struct** · [`ferroui-livecharts`](/docs/0.5.0/api/ferroui-livecharts/) · v0.5.0

```rust
struct OrthographicProjector
```

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

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L8)

## Members

- [`PREFERRED_RATIO`](#assoc_const-preferred_ratio)
- [`new`](#function-new)
- [`map_width`](#function-map_width)
- [`map_height`](#function-map_height)
- [`x_offset`](#function-x_offset)
- [`y_offset`](#function-y_offset)
- [`center_longitude`](#function-center_longitude)
- [`center_latitude`](#function-center_latitude)
- [`radius`](#function-radius)
- [`screen_center_x`](#function-screen_center_x)
- [`screen_center_y`](#function-screen_center_y)
- [`is_visible`](#function-is_visible)
- [`to_map`](#function-to_map)
- [`to_coordinates`](#function-to_coordinates)

<a id="assoc_const-preferred_ratio"></a>

### PREFERRED_RATIO

```rust
const PREFERRED_RATIO: [f64; 2]
```

The aspect ratio of a circular globe.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L24)

<a id="function-new"></a>

### new

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L28)

<a id="function-map_width"></a>

### map_width

```rust
fn map_width(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L52)

<a id="function-map_height"></a>

### map_height

```rust
fn map_height(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L55)

<a id="function-x_offset"></a>

### x_offset

```rust
fn x_offset(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L58)

<a id="function-y_offset"></a>

### y_offset

```rust
fn y_offset(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L61)

<a id="function-center_longitude"></a>

### center_longitude

```rust
fn center_longitude(self: &Self) -> f64
```

The longitude the globe faces.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L65)

<a id="function-center_latitude"></a>

### center_latitude

```rust
fn center_latitude(self: &Self) -> f64
```

The latitude the globe faces.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L69)

<a id="function-radius"></a>

### radius

```rust
fn radius(self: &Self) -> f64
```

The radius of the globe on the screen.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L73)

<a id="function-screen_center_x"></a>

### screen_center_x

```rust
fn screen_center_x(self: &Self) -> f64
```

The screen position of the centre of the globe.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L77)

<a id="function-screen_center_y"></a>

### screen_center_y

```rust
fn screen_center_y(self: &Self) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L80)

<a id="function-is_visible"></a>

### is_visible

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L86)

<a id="function-to_map"></a>

### to_map

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L94)

<a id="function-to_coordinates"></a>

### to_coordinates

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/geo/orthographic_projector.rs#L105)

## 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`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
