0
$\begingroup$

Given a line running through p1:(x1,y1) and p2:(x2,y2),

I need to calculate two points such that a new parallel line 20 pixels away from the given line runs through the two new points.

Edit: The newline can be 20 pixels in either direction (i.e., pick a direction; it does not matter).

  • 1
    20 pixels away - in which direction?2011-11-20
  • 0
    Gerry, it can be 20pixels in either direction.2011-11-20
  • 0
    There are infinitely many directions. Which two do you have in mind?2011-11-21
  • 0
    It's a 2D plane. If for example the given line was vertical,it could be 20 pixels to the left or 20 pixels to the right.2011-11-21
  • 2
    Suppose the line makes a 30 degree angle with the horizontal. Do you want a line 20 pixels to the left? or a line 20 pixels above? or a line 20 pixels away, measured along a perpendicular to the first line? They are all different, and that's just three of the infinitely many different ways to measure the distance between two lines.2011-11-21

2 Answers 2