How is the grounding wire implemented? What determines the number of discrete points between two points? How to calculate this quantity?

I want to get these points for calculating the distance

I believe you can control that with the “granularity” option in GroundPolylineGeometry:

https://cesiumjs.org/Cesium/Build/Documentation/GroundPolylineGeometry.html?classFilter=Polyline

You can check out the source for this file to see how this value is used:

Hope this helps!

Thank you for your answer, I mean I know the coordinates of two points. How to calculate the ground distance between these two points is more accurate. I want to insert a lot of discrete points with two points to calculate the distance, but I don't know how to determine the number of interpolation points between the two points.

Getting the total ground distance isn’t currently supported in CesiumJS. We do have some measurement tools that are currently under development that might help, feel free to reach out to Tim (tim@cesium.com) to learn more about that.

Otherwise, you might have to sample the terrain heights (https://cesiumjs.org/Cesium/Build/Documentation/sampleTerrainMostDetailed.html) and try to approximate it that way.