shashwatak / satellite-js

Modular set of functions for SGP4 and SDP4 propagation of TLEs.
MIT License
902 stars 145 forks source link

In cesuim, I want draw the orbit of the satellite,in ECI Coordinate system。 #92

Closed xingzhenlu closed 3 years ago

xingzhenlu commented 3 years ago

In cesuim,the function that determines the position of an object is “let position = new Cesium.Cartesian3(x, y, z))”. As it happens, there is such a function in satellite.js:

 var positionAndVelocity = satellite.propagate(satrec, times[i]);
 var positionEci = positionAndVelocity.position;
var satelliteX = positionEci.x*1000,
    satelliteY = positionEci.y*1000,
    satelliteZ = positionEci.z*1000;

Of course, each value needs to be multiplied by 1000, converting from kilometers to meters. Enter this x, y, Z into the cesuim function “let position = new Cesium.Cartesian3(x, y, z))”,get the result is not correct! Please point out the maze, thank you!

xingzhenlu commented 3 years ago

It's a matter of radian and angle conversion!

xingzhenlu commented 3 years ago

It's a matter of radian and angle conversion!

yusufcananar commented 5 months ago

How did you solve it? can you share a snippet

thkruz commented 5 months ago

@Fjolnirr you'd be better off opening your own issue if you are having a problem than hoping someone follows up on a 3 year old post where they provided few details.

Based "radian and angle" they where comparing look angle results and forgetting to convert them into degrees (multiply the radians by 180 and divide by Math.PI).