center point on polyline

Hi,

I have a Cesium entity that has a polygon on the surface.

I have the polygon 4 Cartesian3 points.

I need to find the center of the polygon, this polygon will be updated in real time so it wont be a fixed rectangle, trapezoid , etc…

Is there a way to calculate the polygon center Cartesian3 point?

If not, is there a way to calculate a Cartesian3 center point of a polyline?

Thanks.

Hi there,

We don’t have direct support for this yet, so you’ll have to do the calculations yourself. However, you may find this useful: http://cesiumjs.org/Cesium/Build/Documentation/EllipsoidGeodesic.html?classFilter=ellip#EllipsoidGeodesic

Calculates the distance between points along the surface of the ellipsoid. Hope that helps!

Best,

  • Rachel