Bug 1243 : add a function to shift in a given direction
Last modified: 2010-02-17 19:40




Status:
ASSIGNED
Resolution:
-
Priority:
P4
Severity:
enhancement

 

Reporter:
BenHem
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-05-12 18:18
Hi,
I have been pasting this simple scrap of code in almost every visual project I make. It just
finds the X and Y coordinates when shifting a given distance at a given angle. It seems like
something that might be useful to others, maybe it could even find a home in the API?

float chaseX(float startX, float angle, float speed){
return (startX + (speed * cos(angle)));
}

float chaseY(float startY, float angle, float speed) {
return (startY + (speed * sin(angle)));
}
Additional Comment #1 From fry 2010-02-17 19:40
k, we'll leave it in the db so people can vote on it or advocate for its
inclusion.
This bug is now being tracked here.