MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / FixAsin

Function FixAsin

fix/fix.cpp:172–191  ·  view source on GitHub ↗

compute inverse sine

Source from the content-addressed store, hash-verified

170
171// compute inverse sine
172angle FixAsin(float v) {
173 fix vv;
174 int i, f, aa;
175
176 vv = FloatToFix(std::fabs(v));
177
178 if (vv >= F1_0) // check for out of range
179 return 0x4000;
180
181 i = (vv >> 8) & 0xff;
182 f = vv & 0xff;
183
184 aa = asin_table[i];
185 aa = aa + (((asin_table[i + 1] - aa) * f) >> 8);
186
187 if (v < 0)
188 aa = F1_0 - aa;
189
190 return aa;
191}
192
193// compute inverse cosine
194angle FixAcos(float v) {

Callers 1

FixAtan2Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected