01 | local posthree = { } |
02 | posthree.X = 2 |
03 | posthree.Y = 0 |
04 | posthree.Z = 0 |
05 |
06 | local rthree = { } |
07 | rthree.X = 0 |
08 | rthree.Y = 0 |
09 | rthree.Z = 0 |
10 |
11 | local x 3 = posthree.X |
12 | local y 3 = posthree.Y |
13 | local z 3 = posthree.Z |
14 | local rx 3 = rtree.X |
15 | local ry 3 = rtree.Y |
16 | local rz 3 = rtree.Z |
17 |
18 | local x 2 = ((math.cos(math.pi(rx 3 / 180 ))*x 3 ) + (math.sin(math.pi(ry 3 / 180 ))*x 3 ) + (math.sin(math.pi(rz 3 / 180 ))*x 3 )) |
So apperently using math.pi you must use a sign before or after it
1 | local x 2 = ((math.cos(math.pi*((rx 3 / 180 ))*x 3 ) + (math.sin(math.pi*(ry 3 / 180 ))*x 3 ) + (math.sin(math.pi*(rz 3 / 180 ))*x 3 )) |