@@ -84,10 +84,13 @@ uint16_t sintab[256+64+1] = {
84
84
// Its units are fixangs.
85
85
//
86
86
// acos(x) = PI/2 - asin(x). (PI/2 is fixang 0x4000)
87
+ // Note that there are 130 entries in the table. The asin and acos functions
88
+ // will use the low 8 bits to interpolate between entry i and entry i+1: if the
89
+ // parameter is exactly 1, this will be asintab[128] and asintab[129].
87
90
88
91
// indexed by (high 8 bits of (fix >> 2 + 0x4000)
89
92
// clang-format off
90
- fixang asintab [128 + 1 ] = {
93
+ fixang asintab [128 + 1 + 1 ] = {
91
94
0xc001 , 0xc737 , 0xca37 , 0xcc87 , 0xce7c , 0xd037 , 0xd1ca , 0xd33d ,
92
95
0xd498 , 0xd5e0 , 0xd716 , 0xd840 , 0xd95d , 0xda6f , 0xdb78 , 0xdc7a ,
93
96
0xdd73 , 0xde67 , 0xdf54 , 0xe03c , 0xe11e , 0xe1fd , 0xe2d7 , 0xe3ad ,
@@ -104,7 +107,7 @@ fixang asintab[128+1] = {
104
107
0x1b82 , 0x1c54 , 0x1d2a , 0x1e04 , 0x1ee3 , 0x1fc5 , 0x20ad , 0x219a ,
105
108
0x228e , 0x2387 , 0x2489 , 0x2592 , 0x26a4 , 0x27c1 , 0x28eb , 0x2a21 ,
106
109
0x2b69 , 0x2cc4 , 0x2e37 , 0x2fca , 0x3185 , 0x337a , 0x35ca , 0x38ca ,
107
- 0x4000
110
+ 0x4000 , 0x4000
108
111
};
109
112
// clang-format on
110
113
0 commit comments