Abstract2DProjection

Base class for 2D geographic projections that lay out the globe on the XY plane.

Subclasses provide the projection-specific geographic-to-Cartesian math; this class supplies the standard 2D-projection scaffolding: a constant up-vector, an identity-translated local frame, a ray/XY-plane intersection, and the shared bulk grid/border tessellation loops.

The bulk generators geographicToCartesianGrid / geographicToCartesianBorder hold the row/column iteration once for all projections; a subclass supplies only projectPoint (project one geographic point to XY) and, when it can hoist per-latitude work out of the longitude loop, projectRow.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val displayName: String

This projection's display name.

Link copied to clipboard
override val is2D: Boolean = true

Indicates whether this projection is a 2D projection.

Link copied to clipboard

Indicates whether this projection is continuous with itself horizontally.

Link copied to clipboard

Indicates the geographic limits of this projection. May be null to indicate the full range of latitude and longitude.

Functions

Link copied to clipboard
abstract fun cartesianToGeographic(ellipsoid: Ellipsoid, x: Double, y: Double, z: Double, offset: Double, result: Position): Position

Converts a Cartesian point to a geographic position.

Link copied to clipboard
open override fun cartesianToLocalTransform(ellipsoid: Ellipsoid, x: Double, y: Double, z: Double, result: Matrix4): Matrix4
Link copied to clipboard
abstract fun geographicToCartesian(ellipsoid: Ellipsoid, latitude: Angle, longitude: Angle, altitude: Double, offset: Double, result: Vec3): Vec3

Converts a geographic position to Cartesian coordinates.

Link copied to clipboard
open override fun geographicToCartesianBorder(ellipsoid: Ellipsoid, sector: Sector, numLat: Int, numLon: Int, height: Float, origin: Vec3?, offset: Double, result: FloatArray): FloatArray
Link copied to clipboard
open override fun geographicToCartesianGrid(ellipsoid: Ellipsoid, sector: Sector, numLat: Int, numLon: Int, height: FloatArray?, verticalExaggeration: Double, origin: Vec3?, offset: Double, result: FloatArray, rowOffset: Int, rowStride: Int): FloatArray
Link copied to clipboard
open override fun geographicToCartesianNormal(ellipsoid: Ellipsoid, latitude: Angle, longitude: Angle, result: Vec3): Vec3
Link copied to clipboard
open override fun geographicToCartesianTransform(ellipsoid: Ellipsoid, latitude: Angle, longitude: Angle, altitude: Double, result: Matrix4): Matrix4
Link copied to clipboard
open override fun intersect(ellipsoid: Ellipsoid, line: Line, result: Vec3): Boolean

Computes the first intersection of a specified globe and line. The line is interpreted as a ray; intersection points behind the line's origin are ignored.