@JsType(isNative=true, namespace="Cesium", name="Rectangle") public class Rectangle extends Object
Modifier and Type | Field and Description |
---|---|
double |
east
The easternmost longitude in radians in the range [-Pi, Pi].
|
double |
height
Gets the height of the rectangle in radians.
|
double |
north
The northernmost latitude in radians in the range [-Pi/2, Pi/2].
|
static int |
packedLength
The number of elements used to pack the object into an array.
|
double |
south
The southernmost latitude in radians in the range [-Pi/2, Pi/2].
|
double |
west
The westernmost longitude in radians in the range [-Pi, Pi].
|
double |
width
Gets the width of the rectangle in radians.
|
Constructor and Description |
---|
Rectangle()
A two dimensional region specified as longitude and latitude coordinates.
|
Rectangle(double west,
double south,
double east,
double north)
A two dimensional region specified as longitude and latitude coordinates.
|
Modifier and Type | Method and Description |
---|---|
static Cartographic |
center(Rectangle rectangle)
Computes the center of an rectangle.
|
static Cartographic |
center(Rectangle rectangle,
Cartographic result)
Computes the center of an rectangle.
|
Rectangle |
clone()
Duplicates this Rectangle.
|
static Rectangle |
clone(Rectangle rectangle)
Duplicates an Rectangle.
|
static Rectangle |
clone(Rectangle rectangle,
Rectangle result)
Duplicates an Rectangle.
|
static double |
computeHeight(Rectangle rectangle)
Computes the height of a rectangle in radians.
|
static double |
computeWidth(Rectangle rectangle)
Computes the width of a rectangle in radians.
|
static boolean |
contains(Rectangle rectangle,
Cartographic cartographic)
Returns true if the cartographic is on or inside the rectangle, false otherwise.
|
boolean |
equals(Rectangle other)
Compares the provided Rectangle with this Rectangle componentwise and returns true if they are equal, false otherwise.
|
static boolean |
equals(Rectangle left,
Rectangle right)
Compares the provided rectangles and returns true if they are equal, false otherwise.
|
boolean |
equalsEpsilon(Rectangle other,
double epsilon)
Compares the provided Rectangle with this Rectangle componentwise and returns true if they are within the
provided epsilon, false otherwise.
|
static boolean |
equalsEpsilon(Rectangle left,
Rectangle right,
double absoluteEpsilon)
Compares the provided Rectangles componentwise and returns true if they pass an absolute or relative tolerance test,
false otherwise.
|
static Rectangle |
expand(Rectangle rectangle,
Cartographic cartographic)
Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
|
static Rectangle |
expand(Rectangle rectangle,
Cartographic cartographic,
Rectangle result)
Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
|
static Rectangle |
fromCartesianArray(Cartesian2[] cartesians)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian2[] cartesians,
Ellipsoid ellipsoid)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian2[] cartesians,
Ellipsoid ellipsoid,
Rectangle result)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian3[] cartesians)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian3[] cartesians,
Ellipsoid ellipsoid)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian3[] cartesians,
Ellipsoid ellipsoid,
Rectangle result)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian4[] cartesians)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian4[] cartesians,
Ellipsoid ellipsoid)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartesianArray(Cartesian4[] cartesians,
Ellipsoid ellipsoid,
Rectangle result)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartographicArray(Cartographic[] cartographics)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromCartographicArray(Cartographic[] cartographics,
Rectangle result)
Creates the smallest possible Rectangle that encloses all positions in the provided array.
|
static Rectangle |
fromDegrees(double west,
double south,
double east,
double north)
Creates an rectangle given the boundary longitude and latitude in degrees.
|
static Rectangle |
fromDegrees(double west,
double south,
double east,
double north,
Rectangle result)
Creates an rectangle given the boundary longitude and latitude in degrees.
|
static Rectangle |
fromRadians(double west,
double south,
double east,
double north)
Creates an rectangle given the boundary longitude and latitude in radians.
|
static Rectangle |
fromRadians(double west,
double south,
double east,
double north,
Rectangle result)
Creates an rectangle given the boundary longitude and latitude in radians.
|
static Rectangle |
intersection(Rectangle rectangle,
Rectangle otherRectangle)
Computes the intersection of two rectangles
|
static Rectangle |
intersection(Rectangle rectangle,
Rectangle otherRectangle,
Rectangle result)
Computes the intersection of two rectangles
|
static Rectangle |
MAX_VALUE()
The largest possible rectangle.
|
static Cartographic |
northeast(Rectangle rectangle)
Computes the northeast corner of an rectangle.
|
static Cartographic |
northeast(Rectangle rectangle,
Cartographic result)
Computes the northeast corner of an rectangle.
|
static Cartographic |
northwest(Rectangle rectangle)
Computes the northwest corner of an rectangle.
|
static Cartographic |
northwest(Rectangle rectangle,
Cartographic result)
Computes the northwest corner of an rectangle.
|
static double[] |
pack(Rectangle value,
double[] array)
Stores the provided instance into the provided array.
|
static double[] |
pack(Rectangle value,
double[] array,
int startingIndex)
Stores the provided instance into the provided array.
|
static Cartographic |
southeast(Rectangle rectangle)
Computes the southeast corner of an rectangle.
|
static Cartographic |
southeast(Rectangle rectangle,
Cartographic result)
Computes the southeast corner of an rectangle.
|
static Cartographic |
southwest(Rectangle rectangle)
Computes the southwest corner of an rectangle.
|
static Cartographic |
southwest(Rectangle rectangle,
Cartographic result)
Computes the southwest corner of an rectangle.
|
static Cartesian3[] |
subsample(Rectangle rectangle)
Samples an rectangle so that it includes a list of Cartesian points suitable for passing to BoundingSphere#fromPoints.
|
static Cartesian3[] |
subsample(Rectangle rectangle,
Ellipsoid ellipsoid)
Samples an rectangle so that it includes a list of Cartesian points suitable for passing to BoundingSphere#fromPoints.
|
static Cartesian3[] |
subsample(Rectangle rectangle,
Ellipsoid ellipsoid,
double surfaceHeight)
Samples an rectangle so that it includes a list of Cartesian points suitable for passing to BoundingSphere#fromPoints.
|
static Cartesian3[] |
subsample(Rectangle rectangle,
Ellipsoid ellipsoid,
double surfaceHeight,
Cartesian3[] result)
Samples an rectangle so that it includes a list of Cartesian points suitable for passing to BoundingSphere#fromPoints.
|
static Rectangle |
union(Rectangle rectangle,
Rectangle otherRectangle)
Computes a rectangle that is the union of two rectangles.
|
static Rectangle |
union(Rectangle rectangle,
Rectangle otherRectangle,
Rectangle result)
Computes a rectangle that is the union of two rectangles.
|
static Rectangle |
unpack(double[] array)
Retrieves an instance from a packed array.
|
static Rectangle |
unpack(double[] array,
int startingIndex)
Retrieves an instance from a packed array.
|
static Rectangle |
unpack(double[] array,
int startingIndex,
Rectangle result)
Retrieves an instance from a packed array.
|
static void |
validate(Rectangle rectangle)
Checks an Rectangle's properties and throws if they are not in valid ranges.
|
@JsProperty public static int packedLength
@JsProperty public double east
@JsProperty public double height
@JsProperty public double north
@JsProperty public double south
@JsProperty public double west
@JsProperty public double width
@JsConstructor public Rectangle()
Packable
@JsConstructor public Rectangle(double west, double south, double east, double north)
west
- The westernmost longitude, in radians, in the range [-Pi, Pi].south
- The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].east
- The easternmost longitude, in radians, in the range [-Pi, Pi].north
- The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].Packable
@JsProperty(name="MAX_VALUE") public static Rectangle MAX_VALUE()
@JsMethod public static Cartographic center(Rectangle rectangle)
rectangle
- The rectangle for which to find the center@JsMethod public static Cartographic center(Rectangle rectangle, Cartographic result)
rectangle
- The rectangle for which to find the centerresult
- The object onto which to store the result.@JsMethod public static Rectangle clone(Rectangle rectangle)
rectangle
- The rectangle to clone.@JsMethod public static Rectangle clone(Rectangle rectangle, Rectangle result)
rectangle
- The rectangle to clone.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static double computeHeight(Rectangle rectangle)
rectangle
- The rectangle to compute the height of.@JsMethod public static double computeWidth(Rectangle rectangle)
rectangle
- The rectangle to compute the width of.@JsMethod public static boolean contains(Rectangle rectangle, Cartographic cartographic)
rectangle
- The rectanglecartographic
- The cartographic to test.@JsMethod public static boolean equals(Rectangle left, Rectangle right)
left
- The first Rectangle.right
- The second Rectangle.@JsMethod public static boolean equalsEpsilon(Rectangle left, Rectangle right, double absoluteEpsilon)
left
- The first Rectangle.right
- The second Rectangle.absoluteEpsilon
- The absolute epsilon tolerance to use for equality testing.@JsMethod public static Rectangle expand(Rectangle rectangle, Cartographic cartographic)
rectangle
- A rectangle to expand.cartographic
- A cartographic to enclose in a rectangle.@JsMethod public static Rectangle expand(Rectangle rectangle, Cartographic cartographic, Rectangle result)
rectangle
- A rectangle to expand.cartographic
- A cartographic to enclose in a rectangle.result
- The object onto which to store the result.@JsMethod public static Rectangle fromCartesianArray(Cartesian2[] cartesians)
cartesians
- The list of Cartesian instances.@JsMethod public static Rectangle fromCartesianArray(Cartesian2[] cartesians, Ellipsoid ellipsoid)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.@JsMethod public static Rectangle fromCartesianArray(Cartesian2[] cartesians, Ellipsoid ellipsoid, Rectangle result)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle fromCartesianArray(Cartesian3[] cartesians)
cartesians
- The list of Cartesian instances.@JsMethod public static Rectangle fromCartesianArray(Cartesian3[] cartesians, Ellipsoid ellipsoid)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.@JsMethod public static Rectangle fromCartesianArray(Cartesian3[] cartesians, Ellipsoid ellipsoid, Rectangle result)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle fromCartesianArray(Cartesian4[] cartesians)
cartesians
- The list of Cartesian instances.@JsMethod public static Rectangle fromCartesianArray(Cartesian4[] cartesians, Ellipsoid ellipsoid)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.@JsMethod public static Rectangle fromCartesianArray(Cartesian4[] cartesians, Ellipsoid ellipsoid, Rectangle result)
cartesians
- The list of Cartesian instances.ellipsoid
- The ellipsoid the cartesians are on. Default: Ellipsoid.WGS84()
.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle fromCartographicArray(Cartographic[] cartographics)
cartographics
- The list of Cartographic instances.@JsMethod public static Rectangle fromCartographicArray(Cartographic[] cartographics, Rectangle result)
cartographics
- The list of Cartographic instances.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle fromDegrees(double west, double south, double east, double north)
Example:
Rectangle rectangle = Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
west
- The westernmost longitude in degrees in the range [-180.0, 180.0].south
- The southernmost latitude in degrees in the range [-90.0, 90.0].east
- The easternmost longitude in degrees in the range [-180.0, 180.0].north
- The northernmost latitude in degrees in the range [-90.0, 90.0].@JsMethod public static Rectangle fromDegrees(double west, double south, double east, double north, Rectangle result)
Example:
Rectangle rectangle = Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
west
- The westernmost longitude in degrees in the range [-180.0, 180.0].south
- The southernmost latitude in degrees in the range [-90.0, 90.0].east
- The easternmost longitude in degrees in the range [-180.0, 180.0].north
- The northernmost latitude in degrees in the range [-90.0, 90.0].result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle fromRadians(double west, double south, double east, double north)
west
- The westernmost longitude in radians in the range [-Math.PI, Math.PI]. Default: 0.0.south
- The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. Default: 0.0.east
- The easternmost longitude in radians in the range [-Math.PI, Math.PI]. Default: 0.0.north
- The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. Default: 0.0.@JsMethod public static Rectangle fromRadians(double west, double south, double east, double north, Rectangle result)
west
- The westernmost longitude in radians in the range [-Math.PI, Math.PI]. Default: 0.0.south
- The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. Default: 0.0.east
- The easternmost longitude in radians in the range [-Math.PI, Math.PI]. Default: 0.0.north
- The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. Default: 0.0.result
- The object onto which to store the result, or undefined if a new instance should be created.@JsMethod public static Rectangle intersection(Rectangle rectangle, Rectangle otherRectangle)
rectangle
- On rectangle to find an intersectionotherRectangle
- Another rectangle to find an intersection@JsMethod public static Rectangle intersection(Rectangle rectangle, Rectangle otherRectangle, Rectangle result)
rectangle
- On rectangle to find an intersectionotherRectangle
- Another rectangle to find an intersectionresult
- The object onto which to store the result.@JsMethod public static Cartographic northeast(Rectangle rectangle)
rectangle
- The rectangle for which to find the corner@JsMethod public static Cartographic northeast(Rectangle rectangle, Cartographic result)
rectangle
- The rectangle for which to find the cornerresult
- The object onto which to store the result.@JsMethod public static Cartographic northwest(Rectangle rectangle)
rectangle
- The rectangle for which to find the corner@JsMethod public static Cartographic northwest(Rectangle rectangle, Cartographic result)
rectangle
- The rectangle for which to find the cornerresult
- The object onto which to store the result.@JsMethod public static double[] pack(Rectangle value, double[] array)
value
- The value to pack.array
- The array to pack into.@JsMethod public static double[] pack(Rectangle value, double[] array, int startingIndex)
value
- The value to pack.array
- The array to pack into.startingIndex
- The index into the array at which to start packing the elements.@JsMethod public static Cartographic southeast(Rectangle rectangle)
rectangle
- The rectangle for which to find the corner@JsMethod public static Cartographic southeast(Rectangle rectangle, Cartographic result)
rectangle
- The rectangle for which to find the cornerresult
- The object onto which to store the result.@JsMethod public static Cartographic southwest(Rectangle rectangle)
rectangle
- The rectangle for which to find the corner@JsMethod public static Cartographic southwest(Rectangle rectangle, Cartographic result)
rectangle
- The rectangle for which to find the cornerresult
- The object onto which to store the result.@JsMethod public static Cartesian3[] subsample(Rectangle rectangle)
rectangle
- The rectangle to subsample.@JsMethod public static Cartesian3[] subsample(Rectangle rectangle, Ellipsoid ellipsoid)
rectangle
- The rectangle to subsample.ellipsoid
- The ellipsoid to use. Default: Ellipsoid.WGS84()
@JsMethod public static Cartesian3[] subsample(Rectangle rectangle, Ellipsoid ellipsoid, double surfaceHeight)
rectangle
- The rectangle to subsample.ellipsoid
- The ellipsoid to use. Default: Ellipsoid.WGS84()
surfaceHeight
- The height of the rectangle above the ellipsoid. Default: 0.0@JsMethod public static Cartesian3[] subsample(Rectangle rectangle, Ellipsoid ellipsoid, double surfaceHeight, Cartesian3[] result)
rectangle
- The rectangle to subsample.ellipsoid
- The ellipsoid to use. Default: Ellipsoid.WGS84()
surfaceHeight
- The height of the rectangle above the ellipsoid. Default: 0.0result
- The array of Cartesians onto which to store the result.@JsMethod public static Rectangle union(Rectangle rectangle, Rectangle otherRectangle)
rectangle
- A rectangle to enclose in rectangle.otherRectangle
- A rectangle to enclose in a rectangle.public static Rectangle union(Rectangle rectangle, Rectangle otherRectangle, Rectangle result)
rectangle
- A rectangle to enclose in rectangle.otherRectangle
- A rectangle to enclose in a rectangle.result
- The object onto which to store the result.@JsMethod public static Rectangle unpack(double[] array)
array
- The packed array.@JsMethod public static Rectangle unpack(double[] array, int startingIndex)
array
- The packed array.startingIndex
- The starting index of the element to be unpacked. Default: 0@JsMethod public static Rectangle unpack(double[] array, int startingIndex, Rectangle result)
array
- The packed array.startingIndex
- The starting index of the element to be unpacked. Default: 0result
- The object into which to store the result.@JsMethod public static void validate(Rectangle rectangle)
rectangle
- The rectangle to validate@JsMethod public Rectangle clone()
@JsMethod public boolean equals(Rectangle other)
other
- The Rectangle to compare.@JsMethod public boolean equalsEpsilon(Rectangle other, double epsilon)
other
- The Rectangle to compare.epsilon
- The epsilon to use for equality testing.Copyright © 2019. All rights reserved.