( sincos DAY 05.04.2001 )

: sin:
   5 0
   do
     NextWord evaluate w,
   loop
;

decimal here
sin: 0000 0174 0348 0523 0697 
sin: 0871 1045 1218 1391 1564 
sin: 1736 1908 2079 2249 2419 
sin: 2588 2756 2923 3090 3255 
sin: 3420 3583 3746 3907 4067 
sin: 4226 4383 4539 4694 4848 
sin: 5000 5150 5299 5446 5591 
sin: 5735 5877 6018 6156 6293 
sin: 6427 6560 6691 6819 6946 
sin: 7071 7193 7313 7431 7547 
sin: 7660 7771 7880 7986 8090 
sin: 8191 8290 8386 8480 8571 
sin: 8660 8746 8829 8910 8987 
sin: 9063 9135 9205 9271 9335 
sin: 9396 9455 9510 9563 9612 
sin: 9659 9702 9743 9781 9816 
sin: 9848 9876 9902 9925 9945 
sin: 9961 9975 9986 9993 9998
10000 w,

: AdjSin ( n -- -1 n | 1 n )
     360 mod 
     dup 0< if 360 + then
     dup 180 > 
     if 180 - -1  else 1 then
     swap dup 90 > if 180 - negate then 
;  

: sin ( n -- n1 )
     AdjSin
     2* [ dup ] literal + w@ w*
; drop

: cos ( n -- n1 )
     90 + sin
;

: sin* ( n1 n2 -- n3 )
\ n3=n1*sin(n2)
     sin 10000 */
;

: cos* ( n1 n2 -- n3 )
     cos 10000 */
;