* Creates a rectangle given the boundary longitude and latitude in degrees. * * @param {number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0]. * @param {number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0]. * @param {number} [
(west, south, east, north, result)
| 168 | * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0); |
| 169 | */ |
| 170 | static fromDegrees(west, south, east, north, result) { |
| 171 | west = CesiumMath.toRadians(west ?? 0.0); |
| 172 | south = CesiumMath.toRadians(south ?? 0.0); |
| 173 | east = CesiumMath.toRadians(east ?? 0.0); |
| 174 | north = CesiumMath.toRadians(north ?? 0.0); |
| 175 | |
| 176 | if (!defined(result)) { |
| 177 | return new Rectangle(west, south, east, north); |
| 178 | } |
| 179 | |
| 180 | result.west = west; |
| 181 | result.south = south; |
| 182 | result.east = east; |
| 183 | result.north = north; |
| 184 | |
| 185 | return result; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Creates a rectangle given the boundary longitude and latitude in radians. |