# calculating the equation of a line given a point and direction

• Nov 9th 2009, 02:58 PM
jayceekay
calculating the equation of a line given a point and direction
i'm trying to code a simulation for the homicidal chauffeur's problem using maple. i don't know if this is the optimal way to approach the problem, but logically i thought i'd start by programming the chauffeur to start in the direction of the person. given the chauffeur's starting point (x,y) and his original facing direction (a direction in degrees), i could draw a line in the direction he's facing (and it's opposite direction) passing through his starting point, which would divide the cartesian plane into half planes. then depending on which half plane the person is in, the chauffeur would turn that direction (clockwise/counterclockwise). i'm having trouble coming up with the equation for the line which would divide the plane. any help is appreciated!
• Nov 9th 2009, 03:12 PM
skeeter
Quote:

Originally Posted by jayceekay
i'm trying to code a simulation for the homicidal chauffeur's problem using maple. i don't know if this is the optimal way to approach the problem, but logically i thought i'd start by programming the chauffeur to start in the direction of the person. given the chauffeur's starting point (x,y) and his original facing direction (a direction in degrees), i could draw a line in the direction he's facing (and it's opposite direction) passing through his starting point, which would divide the cartesian plane into half planes. then depending on which half plane the person is in, the chauffeur would turn that direction (clockwise/counterclockwise). i'm having trouble coming up with the equation for the line which would divide the plane. any help is appreciated!

if the direction angle, $\theta$ , is referenced relative to the + x-axis, then the slope of the line would be $m = \tan{\theta}$

if the initial position is $(x_0 , y_0)$ , then the linear equation is

$y - y_0 = m(x - x_0)$

$y = \tan{\theta}(x - x_0) + y_0$