I don't know how to describe this EXACTLY

So what i am trying to achieve is this.


Simplified.

What i got is a check if values are exact and if not where are they, how close they are to the exact values, ect… and roblox’ orientation coordinates are weird (might be convertable to 0 360 from the -180 180).
Is there a better, easier way of doing this, or is it just a case of “handle every situation” basically?

I just need a method to doing this, i don’t need a complete script.

1 Like

if you have the angle, just do math.sin(math.rad(x)) assuming x is the angle in degrees.

3 Likes

Thank you.
I can work from here.

1 Like

Can i ask for something?
Can you convert from roblox’ orientation (with minus degrees) to a 0-360 type orientation coordinates

maybe do

function normalizeAngle(angleDegrees)
    if angleDegrees >= 0 then 
        return angleDegrees
    else
        return 360 - (-1 * angleDegrees)
    end
end
1 Like

Also i get weird values like
image
when close to being -1

it probably has something to do with floating point inaccuracies

try math.floor(math.sin(math.rad(x))) instead

1 Like

Can i do a thing where i only calculate to only 2 decimal places? And not to the nearest whole?
(sorry not native english speaker)

Edit: nvm i can look for it :grinning:
thx for helping

np :smile:

psssst… math.floor(math.sin(math.rad(angleDegreesNormalized))/0.01 + 0.5) * 0.01)

1 Like