From 26be4d744ab3848b2dd2e9d18e2a67ade185390b Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Sat, 3 Feb 2024 19:21:41 +0100 Subject: [PATCH] add function that converts degrees to radians --- src/reihen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/reihen.c b/src/reihen.c index 4e3ebb0..b31d063 100644 --- a/src/reihen.c +++ b/src/reihen.c @@ -6,6 +6,8 @@ #include "exponent.h" #include "logarithmus.h" +#define PI pi(1e-8) + unsigned long long fac(int x){ unsigned long long prod = 1; if(x==0) return 1; @@ -30,6 +32,15 @@ double euler(){ return exponential(1); } +double squashDegreesTo360(double x){ + int multiple = x / 360; + return x - (360*multiple); +} + +double radians(double d){ + return d / PI * 180; +} + double pi(double eps){ double a = 1, b = 1/powerD(0.5, 2), t = 0.25, p = 1; double aNew, piold, pi = 1;