#include "maths.h"
//*** Public global variables
// Cosinus table * 1000 every degree
signed short cosinus[360] = {
1000, 999, 999, 998, 997, 996, 994, 992, 990, 987, 984, 981, 978, 974, 970,
965, 961, 956, 951, 945, 939, 933, 927, 920, 913, 906, 898, 891, 882, 874,
866, 857, 848, 838, 829, 819, 809, 798, 788, 777, 766, 754, 743, 731, 719,
707, 694, 681, 669, 656, 642, 629, 615, 601, 587, 573, 559, 544, 529, 515,
500, 484, 469, 453, 438, 422, 406, 390, 374, 358, 342, 325, 309, 292, 275,
258, 241, 224, 207, 190, 173, 156, 139, 121, 104, 87, 69, 52, 34, 17,
0, -18, -35, -53, -70, -88, -105, -122, -140, -157, -174, -191, -208, -225, -242,
-259, -276, -293, -310, -326, -343, -359, -375, -391, -407, -423, -439, -454, -470, -485,
-500, -516, -530, -545, -560, -574, -588, -602, -616, -630, -643, -657, -670, -682, -695,
-708, -720, -732, -744, -755, -767, -778, -789, -799, -810, -820, -830, -839, -849, -858,
-867, -875, -883, -892, -899, -907, -914, -921, -928, -934, -940, -946, -952, -957, -962,
-966, -971, -975, -979, -982, -985, -988, -991, -993, -995, -997, -998, -999,-1000,-1000,
-1000,-1000,-1000, -999, -998, -997, -995, -993, -991, -988, -985, -982, -979, -975, -971,
-966, -962, -957, -952, -946, -940, -934, -928, -921, -914, -907, -899, -892, -883, -875,
-867, -858, -849, -839, -830, -820, -810, -799, -789, -778, -767, -755, -744, -732, -720,
-708, -695, -682, -670, -657, -643, -630, -616, -602, -588, -574, -560, -545, -530, -516,
-501, -485, -470, -454, -439, -423, -407, -391, -375, -359, -343, -326, -310, -293, -276,
-259, -242, -225, -208, -191, -174, -157, -140, -122, -105, -88, -70, -53, -35, -18,
-1, 17, 34, 52, 69, 87, 104, 121, 139, 156, 173, 190, 207, 224, 241,
258, 275, 292, 309, 325, 342, 358, 374, 390, 406, 422, 438, 453, 469, 484,
499, 515, 529, 544, 559, 573, 587, 601, 615, 629, 642, 656, 669, 681, 694,
707, 719, 731, 743, 754, 766, 777, 788, 798, 809, 819, 829, 838, 848, 857,
866, 874, 882, 891, 898, 906, 913, 920, 927, 933, 939, 945, 951, 956, 961,
965, 970, 974, 978, 981, 984, 987, 990, 992, 994, 996, 997, 998, 999, 999,
};
// Sinus table * 1000 every degree
signed short sinus[360] = {
0, 17, 34, 52, 69, 87, 104, 121, 139, 156, 173, 190, 207, 224, 241,
258, 275, 292, 309, 325, 342, 358, 374, 390, 406, 422, 438, 453, 469, 484,
499, 515, 529, 544, 559, 573, 587, 601, 615, 629, 642, 656, 669, 681, 694,
707, 719, 731, 743, 754, 766, 777, 788, 798, 809, 819, 829, 838, 848, 857,
866, 874, 882, 891, 898, 906, 913, 920, 927, 933, 939, 945, 951, 956, 961,
965, 970, 974, 978, 981, 984, 987, 990, 992, 994, 996, 997, 998, 999, 999,
1000, 999, 999, 998, 997, 996, 994, 992, 990, 987, 984, 981, 978, 974, 970,
965, 961, 956, 951, 945, 939, 933, 927, 920, 913, 906, 898, 891, 882, 874,
866, 857, 848, 838, 829, 819, 809, 798, 788, 777, 766, 754, 743, 731, 719,
707, 694, 681, 669, 656, 642, 629, 615, 601, 587, 573, 559, 544, 529, 515,
500, 484, 469, 453, 438, 422, 406, 390, 374, 358, 342, 325, 309, 292, 275,
258, 241, 224, 207, 190, 173, 156, 139, 121, 104, 87, 69, 52, 34, 17,
0, -18, -35, -53, -70, -88, -105, -122, -140, -157, -174, -191, -208, -225, -242,
-259, -276, -293, -310, -326, -343, -359, -375, -391, -407, -423, -439, -454, -470, -485,
-500, -516, -530, -545, -560, -574, -588, -602, -616, -630, -643, -657, -670, -682, -695,
-708, -720, -732, -744, -755, -767, -778, -789, -799, -810, -820, -830, -839, -849, -858,
-867, -875, -883, -892, -899, -907, -914, -921, -928, -934, -940, -946, -952, -957, -962,
-966, -971, -975, -979, -982, -985, -988, -991, -993, -995, -997, -998, -999,-1000,-1000,
-1000,-1000,-1000, -999, -998, -997, -995, -993, -991, -988, -985, -982, -979, -975, -971,
-966, -962, -957, -952, -946, -940, -934, -928, -921, -914, -907, -899, -892, -883, -875,
-867, -858, -849, -839, -830, -820, -810, -799, -789, -778, -767, -755, -744, -732, -720,
-708, -695, -682, -670, -657, -643, -630, -616, -602, -588, -574, -560, -545, -530, -516,
-501, -485, -470, -454, -439, -423, -407, -391, -375, -359, -343, -326, -310, -293, -276,
-259, -242, -225, -208, -191, -174, -157, -140, -122, -105, -88, -70, -53, -35, -18,
};