   Simple problem
  I have what I believe is a simple problem but I can't quite get the math right.I have a line defined by two points (g1, g2). What I need is to find two points (p1, p2) that are of a fixed distance apart (d), that form a line that is perpendicular to that given line.The picture should make the problem a little clearer. Oh, and this isn't for homework.Thanks in advance!   
  You mean both p1 and p2 need to have distance d from g2?How about this:1) Create a vector from g1 to g2. Call it v.2) Create the two perpendicular vectors to v (if the vector is (x, y), the perpendiculars are (-y, x) and (y, -x)).3) Normalize the perpendicular vectors and multiply them by d.4) Add both to g2 to get p1 and p2.EDIT: Made a correction in 4.   ;  (g2 - g1)swap x ynegate xnormalizemultiply by +- dadd g2Edit:  NINJA'D   ;  The speed of the responses on this website never cease to amaze me.Thanks!   