Skip to content

draw satellite orbit #87

Open
Open

Description

@hmovahedim

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

Activity

  1. meNeither commented on Dec 1, 2021

    @meNeither

    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.

  2. hmovahedim commented on Dec 6, 2021

    @hmovahedim
    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 ?

  3. michealroberts commented on Dec 6, 2021

    @michealroberts

    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?

  4. slowe commented on Dec 6, 2021

    @slowe
    Owner

    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.

  5. hmovahedim commented on Dec 7, 2021

    @hmovahedim
    Author

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

  6. slowe commented on Dec 7, 2021

    @slowe
    Owner

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions