Skip to main content

Class: HorizonProjection

Defined in: src/sdk/components/horizon/HorizonProjection.ts:165

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

Constructors

Constructor

new HorizonProjection(projectedWidth, projectedHeight, fov): HorizonProjection

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

Constructor.

Parameters

ParameterTypeDescription
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

Methods

applyQueued()

applyQueued(): void

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

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

Returns

void


getAltitude()

getAltitude(): number

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

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.


getFocalLength()

getFocalLength(): number

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

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.


getFov()

getFov(): number

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

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

Returns

number

The field of view of this projection, in degrees.


getFovEndpoints()

getFovEndpoints(): ReadonlyFloat64Array

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

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

ReadonlyFloat64Array

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.


getHeading()

getHeading(): number

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

Gets the true heading of this projection, in degrees.

Returns

number

The true heading of this projection, in degrees.


getHeadingScaleFactor()

getHeadingScaleFactor(): number

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

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.


getOffsetCenterProjected()

getOffsetCenterProjected(): ReadonlyFloat64Array

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

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

Returns

ReadonlyFloat64Array

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


getPitch()

getPitch(): number

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

Gets the pitch of this projection, in degrees.

Returns

number

The pitch of this projection, in degrees.


getPitchScaleFactor()

getPitchScaleFactor(): number

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

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.


getPosition()

getPosition(): GeoPointReadOnly

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

Gets the position of this projection.

Returns

GeoPointReadOnly

The position of this projection.


getProjectedOffset()

getProjectedOffset(): ReadonlyFloat64Array

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

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

Returns

ReadonlyFloat64Array

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


getProjectedSize()

getProjectedSize(): ReadonlyFloat64Array

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

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

Returns

ReadonlyFloat64Array

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


getRoll()

getRoll(): number

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

Gets the roll of this projection, in degrees.

Returns

number

The roll of this projection, in degrees.


getScaleFactor()

getScaleFactor(): number

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

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.


invertToCameraRelativeAngles()

invertToCameraRelativeAngles(x, y, out): Float64Array

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

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

ParameterTypeDescription
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.


isInProjectedBounds()

Call Signature

isInProjectedBounds(point, altitude, bounds?): boolean

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

Checks whether a point falls within certain projected bounds.

Parameters
ParameterTypeDescription
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.

Call Signature

isInProjectedBounds(point, bounds?): boolean

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

Checks whether a projected point falls within certain projected bounds.

Parameters
ParameterTypeDescription
pointReadonlyFloat64ArrayThe 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.


onChange()

onChange(listener): Subscription

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

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

ParameterTypeDescription
listenerHorizonProjectionChangeListenerThe change listener to subscribe.

Returns

Subscription

The new subscription.


project()

project(position, altitude, out): Float64Array

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

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

Parameters

ParameterTypeDescription
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.


projectCameraRelativeAngular()

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

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

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

ParameterTypeDescription
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.


projectCameraRelativeCoordinates()

Call Signature

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

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

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
ParameterTypeDescription
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.

Call Signature

projectCameraRelativeCoordinates(coords, out): Float64Array

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

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
ParameterTypeDescription
coordsReadonlyFloat64ArrayThe coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.
Returns

Float64Array

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


projectCameraRelativeEuclidean()

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

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

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

ParameterTypeDescription
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.


projectRelativeAngular()

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

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

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

ParameterTypeDescription
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.


projectRelativeCoordinates()

Call Signature

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

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

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
ParameterTypeDescription
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.

Call Signature

projectRelativeCoordinates(coords, out): Float64Array

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

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
ParameterTypeDescription
coordsReadonlyFloat64ArrayThe coordinates to project.
outFloat64ArrayThe 2D vector to which to write the result.
Returns

Float64Array

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


projectRelativeEuclidean()

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

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

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

ParameterTypeDescription
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.


projectRelativeSpherical()

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

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

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

Parameters

ParameterTypeDescription
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.


set()

set(parameters): void

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

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

Parameters

ParameterTypeDescription
parametersHorizonProjectionParametersThe new parameters.

Returns

void


setQueued()

setQueued(parameters): void

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

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

Parameters

ParameterTypeDescription
parametersHorizonProjectionParametersThe parameter changes to queue.

Returns

void