Companion

Properties

Link copied to clipboard

The largest possible rectangle.

Link copied to clipboard
open override val packedLength: Int

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

Functions

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

Computes the center of a rectangle.

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

Duplicates a Rectangle.

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

Computes the height of a rectangle in radians.

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

Computes the width of a rectangle in radians.

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

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

Link copied to clipboard
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
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
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
fun fromBoundingSphere(boundingSphere: BoundingSphere, ellipsoid: Ellipsoid? = definedExternally, result: Rectangle? = definedExternally): Rectangle

Create a rectangle from a bounding sphere, ignoring height.

Link copied to clipboard
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
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
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
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
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
fun northeast(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the northeast corner of a rectangle.

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

Computes the northwest corner of a rectangle.

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

Stores the provided instance into the provided array.

Link copied to clipboard
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
fun southeast(rectangle: Rectangle, result: Cartographic? = definedExternally): Cartographic

Computes the southeast corner of a rectangle.

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

Computes the southwest corner of a rectangle.

Link copied to clipboard
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
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
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 override fun unpack(array: ReadonlyArray<Double>, startingIndex: Int?, result: Rectangle?): Rectangle

Retrieves an instance from a packed array.