Go Back   Orbiter-Forum > Far Side of the Moon > Math & Physics
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Math & Physics Mathematical and physical problems of space flight and astronomy.

Thread Tools
Old 11-02-2018, 11:08 AM   #1
Marijn's Avatar
Default Drawing orbits in 2D using html ellipse element

For a graphical representation of an orbit in 2D, I'd like to use the html SVG ellipse element. I am trying to achieve the same result as http://www.asterank.com/ (in the left pane).

Perhaps someone has already figured this out and could help me with this.

The example below is the (simplified) html for asteroid Ryugu. I am trying to calculate the numbers for drawing the ellipse based on the orbital elements as displayed below the diagram on the Asterank home page.

The semi-major axis, a, is given. The semi-minor axis b can be calculated using e. These numbers need to be multiplied by 50 (pixels) in order to get the values as in the example below.

W is used for the first param of the transform function.

So I am close. But I do not understand how cy is calculated. Also, I need to fit the inclination in somehow.

Can anybody help me to complete this calculation?

svg width="300" height="170"
ellipse rx="58.39395781893142"
transform="rotate(211.4258497031505, 150, 75)"
Marijn is offline   Reply With Quote
Old 11-05-2018, 09:58 AM   #2
Marijn's Avatar

Ok, I found the answer. In case anyone is interested:

cy = eccentricity * semi-major axis * 50 + 75

50 is a scale factor (50px = 1AU) and 75 is the center of the y coordinate.

Completing the example for Ryugu: cy = 1.189545600425906 * 0.1902257533711703 * 50 + 75 = 86.314
Marijn is offline   Reply With Quote
Thanked by:

  Orbiter-Forum > Far Side of the Moon > Math & Physics

Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump

All times are GMT. The time now is 11:05 AM.

Quick Links Need Help?

About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.