From 389cea2bc18a29f34132c41ad1027a1e588b6205 Mon Sep 17 00:00:00 2001 From: GoldenTails <milestailsprower101n2@gmail.com> Date: Tue, 22 Jun 2021 01:38:37 -0500 Subject: [PATCH] You probably don't want to memorise the formula to convert arccos to arcsin so --- src/lua_mathlib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index e6f8c98c13..bd9218a3d5 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -88,6 +88,12 @@ static int lib_finetangent(lua_State *L) return 1; } +static int lib_fixedasin(lua_State *L) +{ + lua_pushangle(L, -FixedAcos(luaL_checkfixed(L, 1)) + ANGLE_90); + return 1; +} + static int lib_fixedacos(lua_State *L) { lua_pushangle(L, FixedAcos(luaL_checkfixed(L, 1))); @@ -199,6 +205,7 @@ static luaL_Reg lib_math[] = { {"sin", lib_finesine}, {"cos", lib_finecosine}, {"tan", lib_finetangent}, + {"asin", lib_fixedasin}, {"acos", lib_fixedacos}, {"FixedAngle", lib_fixedangle}, {"fixangle" , lib_fixedangle}, -- GitLab