Thanks all,
i won't be getting my axon II till next month so i can't actually program or try any code in AVR studio:(. After reading the comments you guy posted i realize that was a stupid question because i have used acos in ms visual basic before and didn't dawn on me that you could just include the math.h library in avr studio........duh......noob fail! thnx though
@Kurt
i'm assuming you've seen my post at lynxmotion only i'm asking if how to do it in basic
Well, after doing some research on "tables" and looking at the phoenix code i created this code that spits out the table so i could graph it in excel to see how actuate it is.
i graphed a perfect acos and then what the table will give. it looks close enough but i will try to get the shape a little better.
After reading some of the comments in the phoenix code i don't understand the math behind getting more accuracy:(
acos var word
counter var word
counter = 0
GetACos bytetable 255,254,252,251,250,249,247,246,245,243,242,241,240,238,237,236,234,233,232,231,229,228,227,225, |
224,223,221,220,219,217,216,215,214,212,211,210,208,207,206,204,203,201,200,199,197,196,195,193, |
192,190,189,188,186,185,183,182,181,179,178,176,175,173,172,170,169,167,166,164,163,161,160,158, |
157,155,154,152,150,149,147,146,144,142,141,139,137,135,134,132,130,128,127,125,123,121,119,117, |
115,113,111,109,107,105,103,101,98,96,94,92,89,87,84,81,79,76,73,73,73,72,72,72,71,71,71,70,70, |
70,70,69,69,69,68,68,68,67,67,67,66,66,66,65,65,65,64,64,64,63,63,63,62,62,62,61,61,61,60,60,59, |
59,59,58,58,58,57,57,57,56,56,55,55,55,54,54,53,53,53,52,52,51,51,51,50,50,49,49,48,48,47,47,47, |
46,46,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,37,37,36,36,35,34,34,33,33,32,31,31,30,29,28, |
28,27,26,25,24,23,23,23,23,22,22,22,22,21,21,21,21,20,20,20,19,19,19,19,18,18,18,17,17,17,17,16, |
16,16,15,15,15,14,14,13,13,13,12,12,11,11,10,10,9,9,8,7,6,6,5,3,0
do
Acos = GetACos(counter)
counter = counter + 1
serout s_out,i9600,[dec Acos,13]
while counter < 278