From b20392a5acf56766f42b7b874e44891ddb6436e3 Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Sun, 4 Feb 2024 15:45:23 +0100 Subject: [PATCH] add tangens function --- src/reihen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/reihen.c b/src/reihen.c index 2190881..556bece 100644 --- a/src/reihen.c +++ b/src/reihen.c @@ -79,4 +79,15 @@ double cosD(double degrees){ else sum -= currvalue; } return sum; +} + +double tanD(double degrees){ + if (degrees>=360.0){ + degrees = squashDegreesTo360(degrees); + } + if(degrees == 90.0 || degrees == 270.0){ + return -1.0; + } + return sinD(degrees)/cosD(degrees); + } \ No newline at end of file