Companion

external object Companion : Packable<Rectangle> (source)

Properties

Link copied to clipboard
external val MAX_VALUE: Rectangle

The largest possible rectangle.

Link copied to clipboard
open external override val packedLength: Int

The number of elements used to pack the object into an array.

Functions

Link copied to clipboard
external fun center(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the center of a rectangle.

Link copied to clipboard
external fun clone(rectangle: Rectangle, result: Rectangle? = definedExternally): Rectangle

Duplicates a Rectangle.

Link copied to clipboard
external fun computeHeight(rectangle: Rectangle): Double

Computes the height of a rectangle in radians.

Link copied to clipboard
external fun computeWidth(rectangle: Rectangle): Double

Computes the width of a rectangle in radians.

Link copied to clipboard
external fun contains(rectangle: Rectangle, cartographic: Cartographic): Boolean

Returns true if the cartographic is on or inside the rectangle, false otherwise.

Link copied to clipboard
external fun equals(left: Rectangle? = definedExternally, right: Rectangle? = definedExternally): Boolean

Compares the provided rectangles and returns true if they are equal, false otherwise.

Link copied to clipboard
external fun equalsEpsilon(left: Rectangle? = definedExternally, right: Rectangle? = definedExternally, absoluteEpsilon: Double? = definedExternally): Boolean

Compares the provided Rectangles componentwise and returns true if they pass an absolute or relative tolerance test, false otherwise.

Link copied to clipboard
external fun expand(rectangle: Rectangle, cartographic: Cartographic, result: Rectangle? = definedExternally): Rectangle

Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.

Link copied to clipboard
external fun fromBoundingSphere(boundingSphere: BoundingSphere, ellipsoid: Ellipsoid? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Create a rectangle from a bounding sphere, ignoring height.

Link copied to clipboard
external fun fromCartesianArray(cartesians: ReadonlyArray<Cartesian3>, ellipsoid: Ellipsoid? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Creates the smallest possible Rectangle that encloses all positions in the provided array.

Link copied to clipboard
external fun fromCartographicArray(cartographics: ReadonlyArray<Cartographic>, result: Rectangle? = definedExternally): Rectangle

Creates the smallest possible Rectangle that encloses all positions in the provided array.

Link copied to clipboard
external fun fromDegrees(west: Double? = definedExternally, south: Double? = definedExternally, east: Double? = definedExternally, north: Double? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Creates a rectangle given the boundary longitude and latitude in degrees.

Link copied to clipboard
external fun fromRadians(west: Double? = definedExternally, south: Double? = definedExternally, east: Double? = definedExternally, north: Double? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Creates a rectangle given the boundary longitude and latitude in radians.

Link copied to clipboard
external fun intersection(rectangle: Rectangle, otherRectangle: Rectangle, result: Rectangle? = definedExternally): Rectangle?

Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are latitude and longitude in radians and produces a correct intersection, taking into account the fact that the same angle can be represented with multiple values as well as the wrapping of longitude at the anti-meridian. For a simple intersection that ignores these factors and can be used with projected coordinates, see Rectangle.simpleIntersection.

Link copied to clipboard
external fun northeast(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the northeast corner of a rectangle.

Link copied to clipboard
external fun northwest(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the northwest corner of a rectangle.

Link copied to clipboard
open external override fun pack(value: Rectangle, array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally): ReadonlyArray<JsDouble>

Stores the provided instance into the provided array.

Link copied to clipboard
external fun simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result: Rectangle? = definedExternally): Rectangle?

Computes a simple intersection of two rectangles. Unlike Rectangle.intersection, this function does not attempt to put the angular coordinates into a consistent range or to account for crossing the anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude and longitude (i.e. projected coordinates).

Link copied to clipboard
external fun southeast(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the southeast corner of a rectangle.

Link copied to clipboard
external fun southwest(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the southwest corner of a rectangle.

Link copied to clipboard
external fun subsample(rectangle: Rectangle, ellipsoid: Ellipsoid? = definedExternally, surfaceHeight: Double? = definedExternally, result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Samples a rectangle so that it includes a list of Cartesian points suitable for passing to BoundingSphere.fromPoints. Sampling is necessary to account for rectangles that cover the poles or cross the equator.

Link copied to clipboard
external fun subsection(rectangle: Rectangle, westLerp: Double, southLerp: Double, eastLerp: Double, northLerp: Double, result: Rectangle? = definedExternally): Rectangle

Computes a subsection of a rectangle from normalized coordinates in the range 0.0, 1.0.

Link copied to clipboard
external fun union(rectangle: Rectangle, otherRectangle: Rectangle, result: Rectangle? = definedExternally): Rectangle

Computes a rectangle that is the union of two rectangles.

Link copied to clipboard
open external override fun unpack(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Retrieves an instance from a packed array.