Not sure if my problem is because of the Sin/Cos functions or with the DrawCircle function....
Is there a library with Sin/Cos functions with high precision (10 digits or more)??
Or a DrawCircle function with high precision?
Explanation:
I'm working on an interactive 2-dimensional star map.
A particular star is placed in space with a set of x,y coordinates.
Its planet is then placed by using the radius of its orbit and its place in the orbit in radians, ie. I use Cos and Sin functions to calculate the planet's x,y coordinates.
I use the same star's coordinates and the orbit's radius to DrawCircle the orbit.
When zoomed out, that I can see planet and star on screen it looks perfect. Planet is on the circle. When zoomed in, that I can see the planet and its moons, the planet is off the circle by up to half a screen width.
I can calculate the misplacement as roughly 0.2% (2 in 1000) but it is not consistant. Bigger orbits have bigger misplacements.
For average applications I would think this error margin would be acceptable, but I use a zoom factor of up to 1 to 10 million (space is pretty big). Where 2 in 1000 is quite noticable.
Is there a library with Sin/Cos functions with high precision (10 digits or more)??
Or a DrawCircle function with high precision?
Explanation:
I'm working on an interactive 2-dimensional star map.
A particular star is placed in space with a set of x,y coordinates.
Its planet is then placed by using the radius of its orbit and its place in the orbit in radians, ie. I use Cos and Sin functions to calculate the planet's x,y coordinates.
I use the same star's coordinates and the orbit's radius to DrawCircle the orbit.
When zoomed out, that I can see planet and star on screen it looks perfect. Planet is on the circle. When zoomed in, that I can see the planet and its moons, the planet is off the circle by up to half a screen width.
I can calculate the misplacement as roughly 0.2% (2 in 1000) but it is not consistant. Bigger orbits have bigger misplacements.
For average applications I would think this error margin would be acceptable, but I use a zoom factor of up to 1 to 10 million (space is pretty big). Where 2 in 1000 is quite noticable.