Re: [AD] a fix struct for dallegro |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2007-04-16, Chris Robinson <chris.kcat@xxxxxxxxxx> wrote:
> On Monday 16 April 2007 04:23:35 pm Peter Wang wrote:
> > The problem here is not float vs fixed but between different angle
> > representations.
>
> Which is inherent in float vs fixed. There's no standard math functions for
> floats that use binary angles, and there's no Allegro math functions for
> fixed types that use radians.
I forgot about that. These trigonometric functions should be named
fix* to distinguish them.
fix cos(fix x) { return x.cos(); }
fix sin(fix x) { return x.sin(); }
fix tan(fix x) { return x.tan(); }
fix acos(fix x) { return x.acos(); }
fix asin(fix x) { return x.asin(); }
fix atan(fix x) { return x.atan(); }
fix atan2(fix x, fix y) { return x.atan2(y); }
Peter