sin,cos,fixed ?

Quote
Julien Aubert <jul...@aubert.pp.se> wrote:
> I'm trying to make some simple rotation on a polygon in Think Pascal 4

> I make two 360 array table of fixed:

> var
> sin,cos:array [360] of fixed;

> ...I set the values of these tables:

> begin
>  for i := 1 to 360 do
>   begin
>    sin[i]:=X2Fix(sin(i));
>    cos[i]:=X2Fix(cos(i));
>   end;
> end;

> But then I look in the "Lightsbug" I see that both tables hase wrong
> values!!!

I believe sin() and cos() takes as input the angle in radians.
At least that's the way it works in C.

If that's the case, you will want to multiply the variable i by
(3.1415926/180).

Hope that helps.

                                        - Bill

--
William Edward Woody                 | In Phase Consulting
wo...@alumni.caltech.edu             | Macintosh & Microsoft Windows
http://www.alumni.caltech.edu/~woody | http://www.znd.net/inphase