I have 4 pairs of longitude & latitude

so is it possible to construct a rectangle?

I create cartesian and use Rectangle.fromCartographicArray, but I get minmal bounding rectangle for my image(

Thank is advance!



fromCartographicArray should work. Are you using radians, not degrees? Do you have a code example?


for example

ca[0] = Cartographic.fromDegrees(130.054128687,42.660675208,0);

ca[1] = Cartographic.fromDegrees(130.340099864,42.706203597, 0);

ca[2] = Cartographic.fromDegrees(130.287676997,42.88136488,0);

ca[3] = Cartographic.fromDegrees(130.000904512,42.835640026,0);

ca[4] = Cartographic.fromDegrees(130.054128687,42.660675208,0);

var extent = Rectangle.fromCartographicArray(ca);

rectangle.coordinates = new ConstantProperty(extent);

entity.position = new ConstantPositionProperty(Ellipsoid.WGS84.cartographicToCartesian(, scratchCartesian), scratchCartographic));

on picture you can see, that I get bounding rectangle(

rectangle.coordinates build rectangle oriented to North? because I have rotated rectangle


so I try to use this formuls from

but I get wrong rotation value

SW: 60.400316388889;5.3194425
SE: 60.400824722222;5.3355405555556
NE: 60.406759444444;5.3347738888889
NW: 60.406251388889;5.3186730555556
$rot= rad2deg (atan ( ( $nw_lng - $sw_lng ) / ($sw_lat - $nw_lat ) / 2  ) );

The Rectangle in Cesium is always aligned to lines of latitude and longitude. Use a Polygon instead, like this Sandcastle example.


Thank you, so much!