Changeset 43 for abuse/trunk/src/lisp.cpp
 Timestamp:
 Mar 2, 2008, 1:58:48 AM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

abuse/trunk/src/lisp.cpp
r39 r43 677 677 } 678 678 679 long lisp_cos(longx)679 int32_t lisp_cos(int32_t x) 680 680 { 681 681 x=(x+FIXED_TRIG_SIZE/4)%FIXED_TRIG_SIZE; … … 684 684 } 685 685 686 long lisp_sin(longx)686 int32_t lisp_sin(int32_t x) 687 687 { 688 688 x=x%FIXED_TRIG_SIZE; … … 691 691 } 692 692 693 long lisp_atan2(long dy, longdx)693 int32_t lisp_atan2(int32_t dy, int32_t dx) 694 694 { 695 695 if (dy==0) … … 709 709 if (abs(dx)>abs(dy)) 710 710 { 711 longa=dx*29/dy;711 int32_t a=dx*29/dy; 712 712 if (a>=TBS) return 0; 713 713 else return 45atan_table[a]; … … 715 715 else 716 716 { 717 longa=dy*29/dx;717 int32_t a=dy*29/dx; 718 718 if (a>=TBS) return 90; 719 719 else return 45+atan_table[a]; … … 723 723 if (abs(dx)>abs(dy)) 724 724 { 725 longa=dx*29/abs(dy);725 int32_t a=dx*29/abs(dy); 726 726 if (a>=TBS) 727 727 return 0; … … 731 731 else 732 732 { 733 longa=abs(dy)*29/dx;733 int32_t a=abs(dy)*29/dx; 734 734 if (a>=TBS) 735 735 return 260; … … 744 744 if (abs(dx)>abs(dy)) 745 745 { 746 longa=dx*29/dy;746 int32_t a=dx*29/dy; 747 747 if (a>=TBS) 748 748 return 135+45; … … 752 752 else 753 753 { 754 longa=dy*29/dx;754 int32_t a=dy*29/dx; 755 755 if (a>=TBS) 756 756 return 13545; … … 762 762 if (abs(dx)>abs(dy)) 763 763 { 764 longa=dx*29/abs(dy);764 int32_t a=dx*29/abs(dy); 765 765 if (a>=TBS) 766 766 return 22545; … … 769 769 else 770 770 { 771 longa=abs(dy)*29/abs(dx);771 int32_t a=abs(dy)*29/abs(dx); 772 772 if (a>=TBS) 773 773 return 225+45;
Note: See TracChangeset
for help on using the changeset viewer.