Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Discrepancies between MoveTo/LineTo and Ellipse?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Oct 9, 2016 7:19 AM Last Post By: Nicholas Gessler
Nicholas Gessler

Posts: 20
Registered: 1/25/98
Discrepancies between MoveTo/LineTo and Ellipse?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2016 1:43 AM
I have written a simulation of the orbits of Jupiter and a ring of asteroids.
Jupiter is rendered with Ellipse, the ring of asteroids by MoveTo/LineTo or Polygon.
When the simulation runs correctly, the orbit of Jupiter is superimposed exactly on the ring of asteroids.

It runs correctly on a Surface Pro with display sizes of:
2160x1440, 1920x1440, 1020x1200
The orbit of Jupiter is smaller than and lower than the ring with display sizes of:
2018x1152, 1920x1080, 1856x1392

On a Lenovo it never runs correctly and the displacements of the Jupiter orbit vary:
1920x1080 the orbit of Jupiter is larger than the ring and higher
1600x900 the orbit of Jupiter is smaller than the ring and lower
1280x720 the orbit of Jupiter is much smaller than the ring and much lower
1024x768 as the above, but instead of circles, all orbits are ellipses (non-square pixels?)

Although the internal .bmp is sized to match the screen resolution of the display, all the
calculations are based on absolute dimensions relative to the center of the display (monitorHeight/2, monitorWidth/2)

I can't believe that there is a discrepancy between MoveTo/LineTo and Ellipse,
but I cannot find problem with the code although the issue must be there.

Any suggestions would be appreciated...
Thanks, Nick (writing from China)
Nicholas Gessler

Posts: 20
Registered: 1/25/98
Re: Discrepancies between MoveTo/LineTo and Ellipse?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2016 7:18 AM   in response to: Nicholas Gessler in response to: Nicholas Gessler
The bug was in my brain and my code...
There's nothing wrong with MoveTo/LineTo and Ellipse.
As I earlier expected, but could not find, monitorHeight was used in the calculation of Mars & Jupiter orbits, but not in the ring of asteroids.
I've fixed the application and it now works on all platforms as "Orbits40" here: https://people.duke.edu/~ng46/borland/orbits.htm

I do have one nagging question though:
When the "screen resolution" is listed as 2160x1440, MonitorWidth and MonitorHeight are 1440x960.
Clearly there is a difference. But what is that difference based upon.

The other nagging problem with the simulation is that in terms of orbital resonances of Jupiter, I get clusters near L3 but none at L4 and L5.
According to theory, reality and better simulations, I should get no cluster at L3, but Trojan clusters at L4 and L5.
Perhaps I cannot compute movements to enough precision...

Thanks for allowing me to take up space on the discussion board.
It helped me solve some of my own problems.

Cheers, Nicmk

Edited by: Nicholas Gessler on Oct 9, 2016 7:19 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02