Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draw satellite orbit #87

Open
hmovahedim opened this issue Dec 1, 2021 · 6 comments
Open

draw satellite orbit #87

hmovahedim opened this issue Dec 1, 2021 · 6 comments

Comments

@hmovahedim
Copy link

Hello
How can i draw satellite orbit from this orbital element(TLE) ?

@meNeither
Copy link

You have to do it yourself. To calculate x and y position via radec2xy, you need azimuth and elevation (to get the right ascension and declination via azel2radec). This in turn can be calculated from the TLE using satellite.js or orb.js.

For a complete implementation, have a look at starlitter.info and my messy source code starting from line 2110.

@hmovahedim
Copy link
Author

You have to do it yourself. To calculate x and y position via radec2xy, you need azimuth and elevation (to get the right ascension and declination via azel2radec). This in turn can be calculated from the TLE using satellite.js or orb.js.

For a complete implementation, have a look at starlitter.info and my messy source code starting from line 2110.

Thank you.
But how can i draw line with x and y position in virtualsky ?

@michealroberts
Copy link

Hi @hmovahedim You need to ascertain the RA and dec values for whatever object you need (the current position would be for new Date()). The trick to getting the "orbital path" would be to extend this datetime to prior and future datetimes ... for whatever time span is appropriate.

For example, if your satellite is geostationary ... it won't have this. So you don't need to worry. However, if the satellite orbits Earth, say once every 90-93 minutes ... extend your x and y calculation for plus / minus 45 - 46.5 minutes.

Does that make sense?

@slowe
Copy link
Owner

slowe commented Dec 6, 2021

Hi @hmovahedim there isn't a simple way for you to do this because it isn't trivial.

As has been said, you'd have to do a lot of the work yourself. You'll need to know the ins and outs of TLEs and the relevant maths for orbital calculations. Parallax is likely to be much more relevant for such close objects as satellites so, for me, this is very unlikely to be trivial.

@hmovahedim
Copy link
Author

hmovahedim commented Dec 7, 2021

I can calculate RA and DEC so how can i draw line with RA and DEC ?

@slowe
Copy link
Owner

slowe commented Dec 7, 2021

@hmovahedim You can't draw a line with one point - you'll need at least two points for any meaningful line. There isn't a good simple answer to "draw a line". You will need to implement line drawing yourself. You could start by looking at the method drawConstellationLines. You could adapt that and remember that not everything in that will be appropriate for your purpose. For instance,

posa = this.radec2xy(this.stars[a][2], this.stars[a][3]);

shows an object - posa - being made from RA/Dec coordinates. In the subsequent lines you can then see how posa and posbare used withmoveToandlineTo` to draw/update a line segment using .

You'll also need to make sure your new function gets called in drawImmediate so that it actually runs. Some other things to consider:

  • have you taken parallax into account?
  • if your lines are "long" you'll probably want to segment them given that the different projections do not automatically take into account curvature - it is not rendered using WebGL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants