Maths vector problem

Miscellaneous Forums/General Discussion/Maths vector problem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It's been a while since I've done this sort of thing, and I'm struggling.

In 2D, I want to detect when a point (p3) is on the wrong side of a line/ray (p1-p2) and move it 'n' units into the 'correct' side of the line. See the diagram below:


I suspect it will need the 2D equivalent of the plane equation, and maybe an intersection point.

Anyone have any code to do this? Any help much appreciated.