Hello,

I have 2 points in a cartesian coordinate system, where the first point is always (0,0). Given the second point and a heading in degrees, how would I write an algorithm to determine if the 2nd point is traveling in the general direction of (0,0) ?

For example:

Point a (0,0)
Point b (10,0)
Point b heading = 270 degrees

This would be true this 270 degrees points right and point b is 10 units right of point a. I would probably also want this is be fuzzy somewhat, in that anything from say + or - 30 degrees would also be true, or something like this.

Does there exist any known algorithms, implemented in C++, to help me with this problem?

Thanks!
Alex