From 20c0d62f833946847c29831126e86aba7c5784ba Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:53:48 +0100 Subject: [PATCH] arcCosine Funktion --- src/c/funktionen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1908340..ccb752f 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -105,3 +105,15 @@ float arcSine(float x) { return 0; } } + +// Function to calculate the arc cosine of a value and return the result in radians +float arcCosine(float x) { + if (x >= -1 && x <= 1) { + return acos(x); + } + else { + printf("Error: Invalid input for arc cosine!\n"); + return 0; + } +} +