Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 22 May 2012 - 10:52 AM
You're not calculating the sin of PI... you're calculating the sin of (float)pi, or (double)pi. PI, as a whole, can't be represented as a float or even a double.
Edited by BruceDawson, 22 May 2012 - 11:12 AM.
Posted 24 May 2012 - 04:27 AM
Posted 24 May 2012 - 06:39 AM
const float imopi = 0.017453292519943295769236907684886;
Posted 24 May 2012 - 09:21 AM
The irrationality of pi is not exactly what the problem is. There are many rational numbers that cannot be expressed exactly in floating-point formats either, like 1/3 or 0.1.
Posted 24 May 2012 - 04:34 PM
Posted 24 May 2012 - 04:40 PM
remember that float can provide certian exactness to computations against some extend. so if you need to get to very low extends, you should linear reduce those extends..... if you want to cumpute angle of earth against its eclipse (the plane that earths orbits the sun, thus 0 degrees exactly), you would have to provide sin (0)... you will never continue with this result unless you apply special data type or special routine of fractionizing the linear space to linear space power.
if you used the minimal epsilon you would end up with earth quite missing its real place.
Posted 24 May 2012 - 06:44 PM
What on Earth is "fractionizing the linear space to linear space power"?
Posted 24 May 2012 - 07:00 PM
No offense, but... YOU'RE NOT MAKING ANY SENSE.What on Earth is "fractionizing the linear space to linear space power"?
Good question. Think about amount of angles of earths sun orbit to its eclipse(plane between earth and sun).
Perfect 0.0.
But you do not never not know exact number, whatever it seems exact...... So "if eclipse of earth is identical to eclipse of earth", it may be volating some amount, hard to measure exact. Numbers can contain many information, the most exponsive information is information about the angle (never ending)
Edited by Cornstalks, 24 May 2012 - 07:01 PM.
Posted 24 May 2012 - 07:18 PM
Posted 24 May 2012 - 07:26 PM
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.