From 9a2f6e2161617e6933ca0d2cf1571a6678803ff8 Mon Sep 17 00:00:00 2001 From: Khaled Date: Sun, 4 Feb 2024 20:43:35 +0100 Subject: [PATCH] arcSine --- src/c/funktionen.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 49c9fa5..1908340 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -93,4 +93,15 @@ float cosine(float x) { // Function to calculate the tangent of an angle in radians float tangent(float x) { return tan(x); -} \ No newline at end of file +} + +// Function to calculate the arc sine of a value and return the result in radians +float arcSine(float x) { + if (x >= -1 && x <= 1) { + return asin(x); + } + else { + printf("Error: Invalid input for arc sine!\n"); + return 0; + } +}