# Rm2k TrigScripts (inspired by Kazesui)

## initTrigPackage()

Here is the maxima script to generate the lookup tables defined in global event "initTrigPackage()":

N : 90$
cosTable : make_array(fixnum, N+1)$
fillarray(cosTable,
    makelist(round(1000 * cos(%pi / 180 * (k))),
        k, 0, N
    )
)$

for k : 0 thru N do(
    display(cosTable[k])
)$

N : 89$
tanTable : make_array(fixnum, N+1)$
fillarray(tanTable,
    makelist(floor(1000 * tan(%pi / 180 * (k + 0.5))),
        k, 0, N
    )
)$

for k : 0 thru N do(
    display(tanTable[k])
)$

## defineTestValues()

Here are the test angles and points used by the "testRoutines" event.
The results by maxima's atan2(..) may differ by 360 degrees, but that really does not matter^^

points : [[4, 3], [6, -20], [-3, -17], [-4, 4], [2, 0], [-3, 0]]$
angles : [-731, -710, -95, 190]$

round(180 / %pi * map(lambda([e], apply(atan2, e)), points)), numer;
round(1000 * cos(%pi / 180 * angles));
round(1000 * sin(%pi / 180 * angles));