Reputation: 25
I'm trying to get the maximum height at which an object was thrown, but it gives me an erroneous result
I made this:
local Vo = 10^2
local a = math.sin(30)^2
local g = 10*2
local H = Vo*a/g
print(H)
Expected: 1.25 Results: 4.88
Upvotes: 0
Views: 58
Reputation: 2938
Your problem began when you assumed that math.sin
takes degrees as argument. It does not. It takes radians:
local Vo = 10^2
local a = math.sin(math.rad(30))^2
local g = 10*2
local H = Vo*a/g
print(H)
-- 1.25
Please refer to lua-users wiki or other references while using functions you have never used before. It really helps.
Upvotes: 3