Moving a point along a vector
- by Chris
Hello-
I have a point defined by x,y and a vector defined by heading, speed. I am attempting to move the point x,y along this vector, at a distance of 'speed'. Below is the code I am currently using:
self.x += self.speed * cos(self.heading);
self.y += self.speed * sin(self.heading);
Heading can be any angle in a full circle - 0 to 2p (0-360…