Author | Rob Hamerling, Michael Watterson Copyright (c) 2009, all rights reserved. |
Adapted-by | Michael Watterson, Eur van Andel |
Compiler | 2.4l |
Collection of mathematical routines.
Several authors.
No dependency found
div_fixed(sword in a, sword in b) return sdword
mult_fixed(sword in a, sword in b) return sdword
abs16(sword in x) return word
byte_to_fixed(byte in int) return sword
sign32(sdword in x) return sbyte
round_fixed(sword in fixed_point) return sbyte
rsin8( sword in radius, sword in angle ) return sword
abs32(sdword in x) return dword
digits_word(word in valu)return byte
sqrt16(word in x) return byte
sign8(sbyte in x) return sbyte
mod_fixed(sword in a, sword in b) return sword
sqrt32(dword in x) return word
abs8(sbyte in x) return byte
sign16(sword in x) return sbyte
rcos8( sword in radius, sword in angle ) return sword
trunc_fixed(sword in fixed_point) return sbyte
const byte SINLOOKUP[] = {0, 3, 8, 12, 17, 21, 26, 30, 35, 39, 43, 48, 52, 57,
sin values scaled to (256 * 1.0) -1 for values above Zero (i.e. add one to lookup if using table directly for other than Zeroth Element) apart from zero, all values are 1 less than actual to allow storage in 1 byte each
polar_to_cartesian(sword in radius, sword in angle, sword out xpos, sword out ypos)
use to rotate angle of a line by calculating endpoints use to generate quadrature waves by changing angle at a fixed speed. if using all 360 degrees in one degree steps, then frequency is step rate / 360 Author: Michael Watterson
div_fixed(sword in a, sword in b) return sdword
No documentation found
mult_fixed(sword in a, sword in b) return sdword
unlike integer max is 128 * 128 *256 approx
abs16(sword in x) return word
No documentation found
byte_to_fixed(byte in int) return sword
fixed point math is 8 bits for decimal in this library. approx two decimal paces, the part after "point" is 0 to 255 sword fixed point numbers are thus -127.00 to +127.00 approx if you want bigger numbers replace all swords by sdwords and sdwords by sbyte*8 if the compiler can do the math still.
sign32(sdword in x) return sbyte
No documentation found
round_fixed(sword in fixed_point) return sbyte
No documentation found
rsin8( sword in radius, sword in angle ) return sword
works with fixed point numbers 256 = 1.0
abs32(sdword in x) return dword
No documentation found
digits_word(word in valu)return byte
No documentation found
sqrt16(word in x) return byte
Calculate the square root of an unsigned 16-bits integer Returns an 8-bits integer Original author: Kyle York
sign8(sbyte in x) return sbyte
No documentation found
mod_fixed(sword in a, sword in b) return sword
probably a better way to do this!
sqrt32(dword in x) return word
Calculate the square root of an unsigned 32-bits integer Returns a 16-bits integer Original author: Kyle York
abs8(sbyte in x) return byte
Author: Eur van Andel, eur@fiwihex.nl
sign16(sword in x) return sbyte
No documentation found
rcos8( sword in radius, sword in angle ) return sword
Author: Michael Watterson
trunc_fixed(sword in fixed_point) return sbyte
No documentation found
16f648a | 16f648a_sqrt.jal |
16f723 | 16f723_sqrt.jal |
16f73 | 16f73_sqrt.jal |
16f877 | 16f877_sqrt.jal |
16f877a | 16f877a_sqrt.jal |
16f88 | 16f88_sqrt.jal |
16f886 | 16f886_math.jal |
18f14k50 | 18f14k50_sqrt.jal |
18f2450 | 18f2450_sqrt.jal |
18f4550 | 18f4550_sqrt.jal |