Browse Source

initial commit

master
William Davis 1 year ago
commit
fe21afe867
  1. 17
      main.py

17
main.py

@ -0,0 +1,17 @@
def sine(deg):
deg %= 360
rad = deg * 3.14 / 180
sin = 0
-------
float sine(int deg) {
deg %= 360; // make it less than 360
float rad = deg * PI / 180;
float sin = 0;
int i;
for(i = 0; i < TERMS; i++) { // That's Taylor series!!
sin += power(-1, i) * power(rad, 2 * i + 1) / fact(2 * i + 1);
}
return sin;
}
Loading…
Cancel
Save