Jump to content

getPointFromDistanceRotation with z ?


Fist

Recommended Posts

I can't figure out on how i can add z calculations for getPointFromDistanceRotation function from useful functions in wiki.

Function is like this

function getPointFromDistanceRotation(x, y, dist, angle)
	local a = math.rad(90-angle)
	local dx = math.cos(a)*dist
	local dy = math.sin(a)*dist
	return x+dx, y+dy;
end

but i need to add a z value as well, so it calculates how far z should go from original position to distance and angle. Anyone can help?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...