Convert WGS84 coordinates to heading and pitch

Hi guys,

How to convert coordinates in WGS84 to the values in heading & pitch as below?

viewer.camera.setView({
destination: new Cesium.Cartesian3(-1271948.097416763, 6241984.514644429, 338489.41055727913),
orientation: {
heading: 0.6269943384362167, //y
pitch: -0.38414946508300485, //x
}