After having followed a discussion about charting in the palm-dev-forum, I felt that the following lookup tables could potentially be useful for some of you. I generated them using SmallBASIC and use them in BallZ(the Palm OS JezzBall clone).

Anyways, the input is in traditional degrees, and the output is a float value. If you are short on memory, you could also transform the input to the sine table to get cosine or vice versa…although this IMHO doesn’t pay out(a simple lookup is faster)…

Enjoy!

P.s. Non-coders…Sorry for the long post…

float cosine[]={1,
0.999847695,
0.999390827,
0.998629535,
0.99756405,
0.996194698,
0.994521895,
0.992546152,
0.990268069,
0.987688341,
0.984807753,
0.981627183,
0.978147601,
0.974370065,
0.970295726,
0.965925826,
0.961261696,
0.956304756,
0.951056516,
0.945518576,
0.939692621,
0.933580426,
0.927183855,
0.920504853,
0.913545458,
0.906307787,
0.898794046,
0.891006524,
0.882947593,
0.874619707,
0.866025404,
0.857167301,
0.848048096,
0.838670568,
0.829037573,
0.819152044,
0.809016994,
0.79863551,
0.788010754,
0.777145961,
0.766044443,
0.75470958,
0.743144825,
0.731353702,
0.7193398,
0.707106781,
0.69465837,
0.68199836,
0.669130606,
0.656059029,
0.64278761,
0.629320391,
0.615661475,
0.601815023,
0.587785252,
0.573576436,
0.559192903,
0.544639035,
0.529919264,
0.515038075,
0.5,
0.48480962,
0.469471563,
0.4539905,
0.438371147,
0.422618262,
0.406736643,
0.390731128,
0.374606593,
0.35836795,
0.342020143,
0.325568154,
0.309016994,
0.292371705,
0.275637356,
0.258819045,
0.241921896,
0.224951054,
0.207911691,
0.190808995,
0.173648178,
0.156434465,
0.139173101,
0.121869343,
0.104528463,
0.087155743,
0.069756474,
0.052335956,
0.034899497,
0.017452406,
2.832769449E-16,
-0.017452406,
-0.034899497,
-0.052335956,
-0.069756474,
-0.087155743,
-0.104528463,
-0.121869343,
-0.139173101,
-0.156434465,
-0.173648178,
-0.190808995,
-0.207911691,
-0.224951054,
-0.241921896,
-0.258819045,
-0.275637356,
-0.292371705,
-0.309016994,
-0.325568154,
-0.342020143,
-0.35836795,
-0.374606593,
-0.390731128,
-0.406736643,
-0.422618262,
-0.438371147,
-0.4539905,
-0.469471563,
-0.48480962,
-0.5,
-0.515038075,
-0.529919264,
-0.544639035,
-0.559192903,
-0.573576436,
-0.587785252,
-0.601815023,
-0.615661475,
-0.629320391,
-0.64278761,
-0.656059029,
-0.669130606,
-0.68199836,
-0.69465837,
-0.707106781,
-0.7193398,
-0.731353702,
-0.743144825,
-0.75470958,
-0.766044443,
-0.777145961,
-0.788010754,
-0.79863551,
-0.809016994,
-0.819152044,
-0.829037573,
-0.838670568,
-0.848048096,
-0.857167301,
-0.866025404,
-0.874619707,
-0.882947593,
-0.891006524,
-0.898794046,
-0.906307787,
-0.913545458,
-0.920504853,
-0.927183855,
-0.933580426,
-0.939692621,
-0.945518576,
-0.951056516,
-0.956304756,
-0.961261696,
-0.965925826,
-0.970295726,
-0.974370065,
-0.978147601,
-0.981627183,
-0.984807753,
-0.987688341,
-0.990268069,
-0.992546152,
-0.994521895,
-0.996194698,
-0.99756405,
-0.998629535,
-0.999390827,
-0.999847695,
-1,-0.999847695,
-0.999390827,
-0.998629535,
-0.99756405,
-0.996194698,
-0.994521895,
-0.992546152,
-0.990268069,
-0.987688341,
-0.984807753,
-0.981627183,
-0.978147601,
-0.974370065,
-0.970295726,
-0.965925826,
-0.961261696,
-0.956304756,
-0.951056516,
-0.945518576,
-0.939692621,
-0.933580426,
-0.927183855,
-0.920504853,
-0.913545458,
-0.906307787,
-0.898794046,
-0.891006524,
-0.882947593,
-0.874619707,
-0.866025404,
-0.857167301,
-0.848048096,
-0.838670568,
-0.829037573,
-0.819152044,
-0.809016994,
-0.79863551,
-0.788010754,
-0.777145961,
-0.766044443,
-0.75470958,
-0.743144825,
-0.731353702,
-0.7193398,
-0.707106781,
-0.69465837,
-0.68199836,
-0.669130606,
-0.656059029,
-0.64278761,
-0.629320391,
-0.615661475,
-0.601815023,
-0.587785252,
-0.573576436,
-0.559192903,
-0.544639035,
-0.529919264,
-0.515038075,
-0.5,
-0.48480962,
-0.469471563,
-0.4539905,
-0.438371147,
-0.422618262,
-0.406736643,
-0.390731128,
-0.374606593,
-0.35836795,
-0.342020143,
-0.325568154,
-0.309016994,
-0.292371705,
-0.275637356,
-0.258819045,
-0.241921896,
-0.224951054,
-0.207911691,
-0.190808995,
-0.173648178,
-0.156434465,
-0.139173101,
-0.121869343,
-0.104528463,
-0.087155743,
-0.069756474,
-0.052335956,
-0.034899497,
-0.017452406,
-1.07187544E-15,
0.017452406,
0.034899497,
0.052335956,
0.069756474,
0.087155743,
0.104528463,
0.121869343,
0.139173101,
0.156434465,
0.173648178,
0.190808995,
0.207911691,
0.224951054,
0.241921896,
0.258819045,
0.275637356,
0.292371705,
0.309016994,
0.325568154,
0.342020143,
0.35836795,
0.374606593,
0.390731128,
0.406736643,
0.422618262,
0.438371147,
0.4539905,
0.469471563,
0.48480962,
0.5,
0.515038075,
0.529919264,
0.544639035,
0.559192903,
0.573576436,
0.587785252,
0.601815023,
0.615661475,
0.629320391,
0.64278761,
0.656059029,
0.669130606,
0.68199836,
0.69465837,
0.707106781,
0.7193398,
0.731353702,
0.743144825,
0.75470958,
0.766044443,
0.777145961,
0.788010754,
0.79863551,
0.809016994,
0.819152044,
0.829037573,
0.838670568,
0.848048096,
0.857167301,
0.866025404,
0.874619707,
0.882947593,
0.891006524,
0.898794046,
0.906307787,
0.913545458,
0.920504853,
0.927183855,
0.933580426,
0.939692621,
0.945518576,
0.951056516,
0.956304756,
0.961261696,
0.965925826,
0.970295726,
0.974370065,
0.978147601,
0.981627183,
0.984807753,
0.987688341,
0.990268069,
0.992546152,
0.994521895,
0.996194698,
0.99756405,
0.998629535,
0.999390827,
0.999847695,
1};

float sine[]=
{0,
0.017452406,
0.034899497,
0.052335956,
0.069756474,
0.087155743,
0.104528463,
0.121869343,
0.139173101,
0.156434465,
0.173648178,
0.190808995,
0.207911691,
0.224951054,
0.241921896,
0.258819045,
0.275637356,
0.292371705,
0.309016994,
0.325568154,
0.342020143,
0.35836795,
0.374606593,
0.390731128,
0.406736643,
0.422618262,
0.438371147,
0.4539905,
0.469471563,
0.48480962,
0.5,
0.515038075,
0.529919264,
0.544639035,
0.559192903,
0.573576436,
0.587785252,
0.601815023,
0.615661475,
0.629320391,
0.64278761,
0.656059029,
0.669130606,
0.68199836,
0.69465837,
0.707106781,
0.7193398,
0.731353702,
0.743144825,
0.75470958,
0.766044443,
0.777145961,
0.788010754,
0.79863551,
0.809016994,
0.819152044,
0.829037573,
0.838670568,
0.848048096,
0.857167301,
0.866025404,
0.874619707,
0.882947593,
0.891006524,
0.898794046,
0.906307787,
0.913545458,
0.920504853,
0.927183855,
0.933580426,
0.939692621,
0.945518576,
0.951056516,
0.956304756,
0.961261696,
0.965925826,
0.970295726,
0.974370065,
0.978147601,
0.981627183,
0.984807753,
0.987688341,
0.990268069,
0.992546152,
0.994521895,
0.996194698,
0.99756405,
0.998629535,
0.999390827,
0.999847695,
1,
0.999847695,
0.999390827,
0.998629535,
0.99756405,
0.996194698,
0.994521895,
0.992546152,
0.990268069,
0.987688341,
0.984807753,
0.981627183,
0.978147601,
0.974370065,
0.970295726,
0.965925826,
0.961261696,
0.956304756,
0.951056516,
0.945518576,
0.939692621,
0.933580426,
0.927183855,
0.920504853,
0.913545458,
0.906307787,
0.898794046,
0.891006524,
0.882947593,
0.874619707,
0.866025404,
0.857167301,
0.848048096,
0.838670568,
0.829037573,
0.819152044,
0.809016994,
0.79863551,
0.788010754,
0.777145961,
0.766044443,
0.75470958,
0.743144825,
0.731353702,
0.7193398,
0.707106781,
0.69465837,
0.68199836,
0.669130606,
0.656059029,
0.64278761,
0.629320391,
0.615661475,
0.601815023,
0.587785252,
0.573576436,
0.559192903,
0.544639035,
0.529919264,
0.515038075,
0.5,
0.48480962,
0.469471563,
0.4539905,
0.438371147,
0.422618262,
0.406736643,
0.390731128,
0.374606593,
0.35836795,
0.342020143,
0.325568154,
0.309016994,
0.292371705,
0.275637356,
0.258819045,
0.241921896,
0.224951054,
0.207911691,
0.190808995,
0.173648178,
0.156434465,
0.139173101,
0.121869343,
0.104528463,
0.087155743,
0.069756474,
0.052335956,
0.034899497,
0.017452406,
5.665538898E-16,
-0.017452406,
-0.034899497,
-0.052335956,
-0.069756474,
-0.087155743,
-0.104528463,
-0.121869343,
-0.139173101,
-0.156434465,
-0.173648178,
-0.190808995,
-0.207911691,
-0.224951054,
-0.241921896,
-0.258819045,
-0.275637356,
-0.292371705,
-0.309016994,
-0.325568154,
-0.342020143,
-0.35836795,
-0.374606593,
-0.390731128,
-0.406736643,
-0.422618262,
-0.438371147,
-0.4539905,
-0.469471563,
-0.48480962,
-0.5,
-0.515038075,
-0.529919264,
-0.544639035,
-0.559192903,
-0.573576436,
-0.587785252,
-0.601815023,
-0.615661475,
-0.629320391,
-0.64278761,
-0.656059029,
-0.669130606,
-0.68199836,
-0.69465837,
-0.707106781,
-0.7193398,
-0.731353702,
-0.743144825,
-0.75470958,
-0.766044443,
-0.777145961,
-0.788010754,
-0.79863551,
-0.809016994,
-0.819152044,
-0.829037573,
-0.838670568,
-0.848048096,
-0.857167301,
-0.866025404,
-0.874619707,
-0.882947593,
-0.891006524,
-0.898794046,
-0.906307787,
-0.913545458,
-0.920504853,
-0.927183855,
-0.933580426,
-0.939692621,
-0.945518576,
-0.951056516,
-0.956304756,
-0.961261696,
-0.965925826,
-0.970295726,
-0.974370065,
-0.978147601,
-0.981627183,
-0.984807753,
-0.987688341,
-0.990268069,
-0.992546152,
-0.994521895,
-0.996194698,
-0.99756405,
-0.998629535,
-0.999390827,
-0.999847695,
-1,
-0.999847695,
-0.999390827,
-0.998629535,
-0.99756405,
-0.996194698,
-0.994521895,
-0.992546152,
-0.990268069,
-0.987688341,
-0.984807753,
-0.981627183,
-0.978147601,
-0.974370065,
-0.970295726,
-0.965925826,
-0.961261696,
-0.956304756,
-0.951056516,
-0.945518576,
-0.939692621,
-0.933580426,
-0.927183855,
-0.920504853,
-0.913545458,
-0.906307787,
-0.898794046,
-0.891006524,
-0.882947593,
-0.874619707,
-0.866025404,
-0.857167301,
-0.848048096,
-0.838670568,
-0.829037573,
-0.819152044,
-0.809016994,
-0.79863551,
-0.788010754,
-0.777145961,
-0.766044443,
-0.75470958,
-0.743144825,
-0.731353702,
-0.7193398,
-0.707106781,
-0.69465837,
-0.68199836,
-0.669130606,
-0.656059029,
-0.64278761,
-0.629320391,
-0.615661475,
-0.601815023,
-0.587785252,
-0.573576436,
-0.559192903,
-0.544639035,
-0.529919264,
-0.515038075,
-0.5,
-0.48480962,
-0.469471563,
-0.4539905,
-0.438371147,
-0.422618262,
-0.406736643,
-0.390731128,
-0.374606593,
-0.35836795,
-0.342020143,
-0.325568154,
-0.309016994,
-0.292371705,
-0.275637356,
-0.258819045,
-0.241921896,
-0.224951054,
-0.207911691,
-0.190808995,
-0.173648178,
-0.156434465,
-0.139173101,
-0.121869343,
-0.104528463,
-0.087155743,
-0.069756474,
-0.052335956,
-0.034899497,
-0.017452406,
-1.13310778E-15};

Related posts:

  1. The Palm table cloth
  2. Download probabilities – the app success probability table

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

© 2013 TamsPalm - the Palm OS / web OS Blog Suffusion theme by Sayontan Sinha