How to get rectangle height and width in meters? [Solved]

Hello,

I’m creating a rectangle and getting its height and width by using computeHeight and computeWidth. As mentioned in the docs, these methods are returning values in Radians.

How can I convert these values in Meters?
Or
How to get Rectangle Width and Height in Meters?

Please suggest.

  • Thanks with Regards

No one has shown interest on this question. I found it’s solution by converting rect north, south, east, west radians values to cartesian3.

let topleftCart3 = Cesium.Cartesian3.fromRadians(rect.west, rect.north);
let bottomleftCart3 = Cesium.Cartesian3.fromRadians(rect.west, rect.south);
let toprightCart3 = Cesium.Cartesian3.fromRadians(rect.east, rect.north);

// converting to length and width:
let lengthDistance = Cesium.Cartesian3.distance(topleftCart3, bottomleftCart3);
let widthDistance =  Cesium.Cartesian3.distance(topleftCart3, toprightCart3);
1 Like