VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calculates how much an object's X and Y will increase if moved in a certain direction at a certain

by Walter Eigner (15 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 20th January 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calculates how much an object's X and Y will increase if moved in a certain direction at a certain speed. Useful for calculating the movement

Rate Calculates how much an object's X and Y will increase if moved in a certain direction at a certain



Function FowardX(rotation, rate As Single) As Single
FowardX = (rate * Cos((rotation - 90) * ((Math.Atn(1) * 4) / 180)))
End Function

Function FowardY(rotation, rate As Single) As Single
FowardY = (rate * Sin((rotation - 90) * ((Math.Atn(1) * 4) / 180)))
End Function 

Download this snippet    Add to My Saved Code

Calculates how much an object's X and Y will increase if moved in a certain direction at a certain Comments

No comments have been posted about Calculates how much an object's X and Y will increase if moved in a certain direction at a certain . Why not be the first to post a comment about Calculates how much an object's X and Y will increase if moved in a certain direction at a certain .

Post your comment

Subject:
Message:
0/1000 characters