4 ; Provides fixed point operations such as trignometry
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's Sapphire library.
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ;----- Overview -------------------------------------------------------------
36 [ :LNOT::DEF:fixedPt__dfn
41 ; On entry: R0 == x, in 16.16 fixed point form
43 ; On exit: R0 == arctan x, in degrees, in 16.16 fixed point
45 ; Use: Calculates arctan x, hopefully fairly swiftly. The
46 ; accuracy of the result is open to doubt, although
47 ; it's usually good to about 3 significant figures.
48 ; It uses a small lookup table and linear interpolation
49 ; to calculate the result.
55 ; On entry: R0 == x coordinate
58 ; On exit: R0 == angle in degrees, in 16.16 form
60 ; Use: Calculates the angle a vector makes with the +ve x axis.
61 ; The angle is given in degrees, rather than radians,
62 ; although this isn't really overly significant; it just
63 ; makes it slightly easier to work with, because it's
66 ; This routine uses the arctan table and linear
67 ; interpolation, so it's fairly quick, but the accuracy
68 ; of its results is restricted to about 3 significant figures.
74 ; On entry: R0 == angle in degrees, in 16.16 form
76 ; On exit: R0 == sin of angle, in 16.16 form
78 ; Use: Calculates a sin of an angle with a degree of swiftness and
79 ; a lot less accuracy.
85 ; On entry: R0 == angle in degrees, in 16.16 form
87 ; On exit: R0 == cos of angle, in 16.16 form
89 ; Use: Calculates a cos of an angle with a degree of swiftness and
90 ; a lot less accuracy.
96 ;----- That's all, folks ----------------------------------------------------