Calculate a new point based on distance and angle from existing point

1. A concise explanation of the problem you’re experiencing.

Need a way to calculate a new point given a small distance (such as 1 meter) and angle from an existing point.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Not a bug, just my ignorance. I apologize in advance. I spent some time looking for a solution and failed to find anything that was not squirely. Thank for any help.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

We are drawing electric and telecom equipment from models we have created. Looks and performs great. (Poles, fuses, transformers, conductors etc). Need a way to calculate a new point (the point at the end of the cross bar) given a small distance and angle from an existing point (the pole’s point) so we when we draw the conductor from pole to pole, its end points are on the correct point of the crossbar of the pole. We have the crossbar height, angle and length. So on a 3 phase line, there will be 3 wires going from one pole to another. One close to the top of the pole and 2 and the ends of the crossbars.

4. The Cesium version you’re using, your operating system and browser.

Cesium 1.46 MacOS high Sierra 10.13.5. Chrome.

This seems to work. Don’t know if there is an easier way.

// my initial position is “position”

// angle is “degree”

// new position is finalPos

var ellipsoid = Cesium.Ellipsoid.WGS84;

var firstPos=Cesium.Cartesian3.fromRadians(position.longitude,position.latitude, position.height);

var ENU = new Cesium.Matrix4();


var myx=vectorLengthMath.sin(degree180/Math.PI);

var myy=vectorLengthMath.cos(degree180/Math.PI);

var offset=new Cesium.Cartesian3(myx,myy,0);

var finalPos = Cesium.Matrix4.multiplyByPoint(ENU, offset, new Cesium.Cartesian3());