math.lerp pentru euler angles (generat de chatgpt pentru python, convertit de mine pentru lua)
function lerp_angle(start_angle, end_angle, progress)
local start_angle = math.rad(start_angle)
local end_angle = math.rad(end_angle)
if math.abs(end_angle - start_angle) > math.pi then
if end_angle > start_angle then
start_angle = start_angle + 2*math.pi
else
end_angle = end_angle + 2*math.pi
end
end
local angle = (1 - progress) * start_angle + progress * end_angle
return math.deg(angle)
end