API (v2.0.0) - Giro3D
    Preparing search index...

    A configurable spheroid that allows conversion from and to geodetic coordinates and cartesian coordinates, as well as utility function to compute various geodetic values.

    Index

    Constructors

    Accessors

    Methods

    • Gets the ENU (east/north/up) matrix for the given location in geodetic coordinates.

      Parameters

      • lat: number

        The latitude of the location.

      • lon: number

        The longitude of the location.

      • Optionaltarget: Matrix4

      Returns Matrix4

      The ENU matrix.

    • Gets the ENU (east/north/up) matrix for the given location.

      Parameters

      • point: Readonly<Vector3>

        The cartesian coordinate in the geocentric system of this ellipsoid.

      • Optionaltarget: Matrix4

        The optional matrix to set with the ENU matrix.

      Returns Matrix4

      The ENU matrix.

    • Gets the dimensions (width and height) across the center of of the extent, in meters.

      Note: this is distinct to Extent.dimensions which returns the dimensions in the extent's own CRS (meters or degrees).

      Parameters

      • extent: Extent

        The extent.

      • Optionaltarget: Vector2

        The object to store the result. If none, one will be created.

      Returns Vector2

      The extent dimensions.

      if the extent is not in the EPSG:4326 CRS.

    • Returns an approximated length of the meridian arc of the given angle, in meters.

      Note: this function uses a very simplified method, as the actual method involves intrgrals. For very oblate spheroids, the results will be wrong.

      Parameters

      • latitude0: number

        The latitude of the start of the meridian arc

      • latitude1: number

        The latitude of the end of the meridian arc

      Returns number

    • Returns the normal of the spheroid for the given location.

      Parameters

      • lat: number

        The latitude, in degrees.

      • lon: number

        The longitude, in degrees.

      • Optionaltarget: Vector3

        The target vector to store the result. If none, one will be created.

      Returns Vector3

      The normal vector.

    • Returns the normal of the spheroid for the given cartesian coordinate.

      Parameters

      • cartesian: Readonly<Vector3>

        The cartesian coordinates.

      • Optionaltarget: Vector3

        The target vector to store the result. If none, one will be created.

      Returns Vector3

      The normal vector.

    • Gets the distance to the horizon given a camera position.

      Parameters

      • cameraPosition: Vector3

        The camera position.

      • Optionalcenter: Vector3

        The center of the ellipsoid (by default (0, 0, 0)).

      Returns number | null

      The distance, in meters, from the camera to the horizon.

    • Returns the length of the parallel arc of the given angle, in meters.

      Parameters

      • latitude: number

        The latitude of the parallel.

      • angle: number

        The angle of the arc in degrees.

      Returns number

    • Returns the first intersection of the ray with the ellipsoid, or null if the ray does not intersect the ellipsoid.

      Parameters

      • ray: Ray

        The ray to intersect.

      • Optionaltarget: Vector3

        The optional vector to store the result.

      Returns Vector3 | null

      The intersection or null if not intersection was found.

    • Determine whether the given point is visible from the camera or occluded by the horizon of this ellipsoid.

      Parameters

      • cameraPosition: Vector3

        The camera position, in world space coordinates.

      • point: Vector3

        The point to test, in world space coordinates.

      • radiusFactor: number = 1

        An optional factor to apply to ellipsoid radii to add a margin of error.

      Returns boolean

      true if the given point is above the horizon, false otherwise.

    • Converts the geodetic coordinates to cartesian coordinates in the ECEF coordinate system.

      Parameters

      • lat: number

        The latitude, in degrees.

      • lon: number

        The longitude, in degrees.

      • alt: number

        The altitude, in meters, above or below the ellipsoid.

      • Optionaltarget: Vector3

        The target vector. If none, one will be created.

      Returns Vector3

      The cartesian coordinates.