Skip to main content

Class: HorizonProjection

A perspective projection from the point of view of an airplane.

Constructors

constructor

new HorizonProjection(projectedWidth, projectedHeight, fov): HorizonProjection

Constructor.

Parameters

NameTypeDescription
projectedWidthnumberThe initial projected width of the projection, in pixels.
projectedHeightnumberThe initial projected height of the projection, in pixels.
fovnumberThe initial field of view of the projection, in degrees.

Returns

HorizonProjection

Defined in

src/sdk/components/horizon/HorizonProjection.ts:232

Methods

applyQueued

applyQueued(): void

Applies the set of queued projection changes, if any are queued.

Returns

void

Defined in

src/sdk/components/horizon/HorizonProjection.ts:460


getAltitude

getAltitude(): number

Gets the altitude of this projection, in meters above mean sea level.

Returns

number

The altitude of this projection, in meters above mean sea level.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:253


getFocalLength

getFocalLength(): number

Gets the focal length of this projection, in meters. The focal length is set such that one meter at a distance from the camera equal to the focal length subtends an angle equal to the field of view.

Returns

number

The focal length of this projection, in meters.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:312


getFov

getFov(): number

Gets the field of view of this projection, in degrees.

Returns

number

The field of view of this projection, in degrees.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:293


getFovEndpoints

getFovEndpoints(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

Gets the projected endpoints at which the field of view is measured, as [x1, y1, x2, y2], with each component expressed relative to the width or height of the projected window.

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

The projected endpoints at which the field of view is measured, as [x1, y1, x2, y2], with each component expressed relative to the width or height of the projected window.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:303


getHeading

getHeading(): number

Gets the true heading of this projection, in degrees.

Returns

number

The true heading of this projection, in degrees.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:261


getHeadingScaleFactor

getHeadingScaleFactor(): number

Gets the heading angle scale factor of this projection. When a point is projected, its relative heading angle is scaled by this value before projection. The relative heading angle of a point is the difference between the bearing of the point from the airplane and the airplane's heading. A scaling factor of 1 leaves points unchanged. Factors less than 1 cause points to be projected closer to the lubber line. Factors greater than 1 cause points to be projected farther from the lubber line.

Returns

number

The heading angle scale factor of this projection.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:337


getOffsetCenterProjected

getOffsetCenterProjected(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

Gets the projected center of this projection, including offset, as [x, y] in pixels.

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

The projected center of this projection, including offset, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:362


getPitch

getPitch(): number

Gets the pitch of this projection, in degrees.

Returns

number

The pitch of this projection, in degrees.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:269


getPitchScaleFactor

getPitchScaleFactor(): number

Gets the pitch angle scale factor of this projection. When a point is projected, its relative zero-roll pitch angle is scaled by this value before projection. The relative zero-roll pitch angle of a point is the pitch angle of the point relative to the camera if the airplane had zero degrees of roll. A scaling factor of 1 leaves points unchanged. Factors less than 1 cause points to be projected closer to the pitch line corresponding to the airplane's pitch. Factors greater than 1 cause points to be projected farther from the pitch line corresponding to the airplane's pitch.

Returns

number

The pitch angle scale factor of this projection.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:325


getPosition

getPosition(): GeoPointReadOnly

Gets the position of this projection.

Returns

GeoPointReadOnly

The position of this projection.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:245


getProjectedOffset

getProjectedOffset(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

Gets the projected offset of this projection's center, as [x, y] in pixels.

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

The projected offset of this projection's center, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:354


getProjectedSize

getProjectedSize(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

Gets the size of the projected window, as [width, height] in pixels.

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

The size of the projected window, as [width, height] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:285


getRoll

getRoll(): number

Gets the roll of this projection, in degrees.

Returns

number

The roll of this projection, in degrees.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:277


getScaleFactor

getScaleFactor(): number

Gets the nominal scale factor of this projection. At a distance from the camera equal to the focal length, one meter will be projected to a number of pixels equal to the nominal scale factor.

Returns

number

The nominal scale factor of this projection.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:346


invertToCameraRelativeAngles

invertToCameraRelativeAngles(x, y, out): Float64Array

Inverts a pair of projected coordinates to calculate the pitch angle and true bearing (both relative to the horizontal plane with origin at the camera) of the set of points in 3D space that are projected to those coordinates.

Parameters

NameTypeDescription
xnumberThe projected x coordinate to invert.
ynumberThe projected y coordinate to invert.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The pitch angle and true bearing (both relative to the horizontal plane with origin at the camera) of the set of points in 3D space that are projected to the specified coordinates, as [pitch angle, true bearing] in degrees.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:783


isInProjectedBounds

isInProjectedBounds(point, altitude, bounds?): boolean

Checks whether a point falls within certain projected bounds.

Parameters

NameTypeDescription
pointLatLonInterfaceThe lat/lon coordinates of the point to check.
altitudenumberThe altitude of the point to check, in meters.
bounds?Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The bounds to check against, expressed as [left, top, right, bottom] in pixels. Defaults to the bounds of the projected window.

Returns

boolean

Whether the point falls within the projected bounds.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:872

isInProjectedBounds(point, bounds?): boolean

Checks whether a projected point falls within certain projected bounds.

Parameters

NameTypeDescription
pointReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The projected point to check, as [x, y] in pixels.
bounds?Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The bounds to check against, expressed as [left, top, right, bottom] in pixels. Defaults to the bounds of the projected window.

Returns

boolean

Whether the point falls within the projected bounds.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:880


onChange

onChange(listener): Subscription

Subscribes a change listener to this projection. The listener will be called every time this projection changes. A listener can be subscribed multiple times; it will be called once for every time it is registered.

Parameters

NameTypeDescription
listenerHorizonProjectionChangeListenerThe change listener to subscribe.

Returns

Subscription

The new subscription.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:528


project

project(position, altitude, out): Float64Array

Projects a point represented by a set of lat/lon coordinates and altitude.

Parameters

NameTypeDescription
positionLatLonInterfaceThe lat/lon coordinates of the point to project.
altitudenumberThe altitude of the point to project, in meters.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:539


projectCameraRelativeAngular

projectCameraRelativeAngular(distance, bearing, pitch, out): Float64Array

Projects a point relative to the position of the projection camera in Euclidean space. The point to project is expressed in terms of distance, bearing and pitch. The coordinate system is defined at the position of the camera, with the vertical axis perpendicular to the surface of the Earth and the horizontal plane parallel to the Earth's surface at the point directly underneath the camera.

Parameters

NameTypeDescription
distancenumberThe Euclidean distance from the point to project to the camera, in meters.
bearingnumberThe true bearing from the camera to the point to project, in degrees.
pitchnumberThe pitch angle from the camera to the point to project, in degrees. The pitch angle is measured relative to the horizontal plane, with positive angles sweeping above the plane.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:736


projectCameraRelativeCoordinates

projectCameraRelativeCoordinates(x, y, z, out): Float64Array

Projects a set of 3D coordinates defined relative to the camera, as [x, y, z] in meters with the coordinate system defined as follows for an airplane with heading/roll/pitch of zero degrees:

  • The positive z axis points in the direction of the airplane.
  • The positive x axis points directly upward.
  • The positive y axis points to the right.

Parameters

NameTypeDescription
xnumberThe x component of the coordinates to project.
ynumberThe y component of the coordinates to project.
znumberThe z component of the coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:682

projectCameraRelativeCoordinates(coords, out): Float64Array

Projects a set of 3D coordinates defined relative to the camera, as [x, y, z] in meters with the coordinate system defined as follows for an airplane with heading/roll/pitch of zero degrees:

  • The positive z axis points in the direction of the airplane.
  • The positive x axis points directly upward.
  • The positive y axis points to the right.

Parameters

NameTypeDescription
coordsReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:693


projectCameraRelativeEuclidean

projectCameraRelativeEuclidean(bearing, distance, height, out): Float64Array

Projects a point relative to the position of the projection camera in Euclidean space. The point to project is expressed in terms of bearing, horizontal distance, and height. The coordinate system is defined at the position of the camera, with the vertical axis perpendicular to the surface of the Earth and the horizontal plane parallel to the Earth's surface at the point directly underneath the camera.

Parameters

NameTypeDescription
bearingnumberThe true bearing from the camera to the point to project, in degrees.
distancenumberThe Euclidean horizontal distance from the point to project to the camera, in meters.
heightnumberThe Euclidean height of the point to project relative to the camera, in meters.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:714


projectRelativeAngular

projectRelativeAngular(distance, bearing, pitch, out): Float64Array

Projects a point relative to the position of the airplane in Euclidean space. The point to project is expressed in terms of distance, relative bearing and pitch. The coordinate system is defined at the position of the airplane, with the vertical axis perpendicular to the surface of the Earth and the horizontal plane parallel to the Earth's surface at the point directly underneath the airplane.

Parameters

NameTypeDescription
distancenumberThe Euclidean distance from the point to project to the airplane, in meters.
bearingnumberThe relative bearing from the airplane to the point to project, in degrees. The relative bearing is measured relative to the airplane's heading, with positive angles sweeping clockwise when viewed from above.
pitchnumberThe pitch angle from the airplane to the point to project, in degrees. The pitch angle is measured relative to the horizontal plane, with positive angles sweeping above the plane.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:631


projectRelativeCoordinates

projectRelativeCoordinates(x, y, z, out): Float64Array

Projects a set of 3D coordinates defined relative to the airplane, as [x, y, z] in meters with the coordinate system defined as follows for an airplane with heading/roll/pitch of zero degrees:

  • The positive z axis points in the direction of the airplane.
  • The positive x axis points directly upward.
  • The positive y axis points to the right.

Parameters

NameTypeDescription
xnumberThe x component of the coordinates to project.
ynumberThe y component of the coordinates to project.
znumberThe z component of the coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:560

projectRelativeCoordinates(coords, out): Float64Array

Projects a set of 3D coordinates defined relative to the airplane, as [x, y, z] in meters with the coordinate system defined as follows for an airplane with heading/roll/pitch of zero degrees:

  • The positive z axis points in the direction of the airplane.
  • The positive x axis points directly upward.
  • The positive y axis points to the right.

Parameters

NameTypeDescription
coordsReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:571


projectRelativeEuclidean

projectRelativeEuclidean(bearing, distance, height, out): Float64Array

Projects a point relative to the position of the airplane in Euclidean space. The point ot project is expressed in terms of bearing, horizontal distance, and height. The coordinate system is defined at the position of the airplane, with the vertical axis perpendicular to the surface of the Earth and the horizontal plane parallel to the Earth's surface at the point directly underneath the airplane.

Parameters

NameTypeDescription
bearingnumberThe true bearing from the airplane to the point to project, in degrees.
distancenumberThe Euclidean horizontal distance from the point to project to the airplane, in meters.
heightnumberThe Euclidean height of the point to project relative to the airplane, in meters.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:608


projectRelativeSpherical

projectRelativeSpherical(bearing, distance, height, out): Float64Array

Projects a point relative to the position of the airplane in spherical space.

Parameters

NameTypeDescription
bearingnumberThe true bearing from the airplane to the point to project, in degrees.
distancenumberThe geodetic horizontal distance from the point to project to the airplane, in meters.
heightnumberThe geodetic height of the point to project relative to the airplane, in meters.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The projected point, as [x, y] in pixels.

Defined in

src/sdk/components/horizon/HorizonProjection.ts:589


set

set(parameters): void

Sets this projection's parameters. Parameters not explicitly defined in the parameters argument will be left unchanged.

Parameters

NameTypeDescription
parametersHorizonProjectionParametersThe new parameters.

Returns

void

Defined in

src/sdk/components/horizon/HorizonProjection.ts:413


setQueued

setQueued(parameters): void

Sets the projection parameters to be applied when applyQueued() is called.

Parameters

NameTypeDescription
parametersHorizonProjectionParametersThe parameter changes to queue.

Returns

void

Defined in

src/sdk/components/horizon/HorizonProjection.ts:452