chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / csapph / h / fixedPt
1 /*
2  * fixedPt.h
3  *
4  * [Generated from fixedPt, 25 September 1996]
5  */
6
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8   #error You must use the Norcroft ARM Compiler for Sapphire programs
9 #endif
10
11 #pragma include_only_once
12 #pragma force_top_level
13
14 #ifndef __fixedPt_h
15 #define __fixedPt_h
16
17 #ifndef __sapphire_h
18   #include "sapphire.h"
19 #endif
20
21 /*----- Overview ----------------------------------------------------------*
22  *
23  * Functions provided:
24  *
25  *  fxp_atan
26  *  fxp_pol
27  *  fxp_sin
28  *  fxp_cos
29  */
30
31 /* --- fxp_atan --- *
32  *
33  * On entry:    R0 == x, in 16.16 fixed point form
34  *
35  * On exit:     R0 == arctan x, in degrees, in 16.16 fixed point
36  *
37  * Use:         Calculates arctan x, hopefully fairly swiftly. The
38  *              accuracy of the result is open to doubt, although
39  *              it's usually good to about 3 significant figures.
40  *              It uses a small lookup table and linear interpolation
41  *              to calculate the result.
42  */
43
44 extern routine fxp_atan;
45
46 /* --- fxp_pol --- *
47  *
48  * On entry:    R0 == x coordinate
49  *              R1 == y coordinate
50  *
51  * On exit:     R0 == angle in degrees, in 16.16 form
52  *
53  * Use:         Calculates the angle a vector makes with the +ve x axis.
54  *              The angle is given in degrees, rather than radians,
55  *              although this isn't really overly significant; it just
56  *              makes it slightly easier to work with, because it's
57  *              bigger.
58  *
59  *              This routine uses the arctan table and linear
60  *              interpolation, so it's fairly quick, but the accuracy
61  *              of its results is restricted to about 3 significant figures.
62  */
63
64 extern routine fxp_pol;
65
66 /* --- fxp_sin --- *
67  *
68  * On entry:    R0 == angle in degrees, in 16.16 form
69  *
70  * On exit:     R0 == sin of angle, in 16.16 form
71  *
72  * Use:         Calculates a sin of an angle with a degree of swiftness and
73  *              a lot less accuracy.
74  */
75
76 extern routine fxp_sin;
77
78 /* --- fxp_cos --- *
79  *
80  * On entry:    R0 == angle in degrees, in 16.16 form
81  *
82  * On exit:     R0 == cos of angle, in 16.16 form
83  *
84  * Use:         Calculates a cos of an angle with a degree of swiftness and
85  *              a lot less accuracy.
86  */
87
88 extern routine fxp_cos;
89
90 /*----- That's all, folks -------------------------------------------------*/
91
92 #endif