Math.asin and math.sin

Hi, I was testing math.asin and math.sin. I’m a little confused though.

print(math.sin(2)) -- 0.90929742682568
print(math.asin(0.90929742682568)) -- This should equal 2 but instead it gave me 1.1415926535898

According to what I’ve read math.asin should give me the inverse of math.sin. In this case it didn’t.
Can anyone tell me why math.asin gave me 1.1415926535898?

Any article or pieces of code would be greatly appreciated!

1 Like

Odd. Just must be the way you have it. Here is seems to be working:

local angle = math.rad(50)

local sin = math.sin(angle)

local asin = math.asin(sin)

print(math.deg(asin))

degrees are much easier to read.

1 Like

Alright, let me try this. I’ll let you know if it works.

It should print 50 just like we inputed. basiclly i convert the degrees into radians(what roblox uses). then i do the stuff then return back the result of it.

1 Like

Alright, it worked thanks for the help!

1 Like

I have a question. You put the sin into radians, so then why did you have to convert the asin into degrees?

Edit: I found the answer.

Oh thats because you can actually get 0.909 from both math.sin(2) and math.sin(1.14). It just gave you one of them