Line Equation with angle

Viewed 70929

How can I find equation of a line or draw a line, given a starting point, length of line and angle of line (relative to x-axis)?

6 Answers

To compute the line equation from a point (x1, y1), and an arbitrary angle α we need to distinguish two cases:

  1. If α is around k * pi/2 with k = +/-1, +/-2,... then the line equation is
    x =  my + b
    
    with
    m = cot(α)
    b = x1 - m * y1;
    
  2. else the line equation is
    y =  mx + b
    
    with
    m = tan(α)
    b = y1 - m * x1
    
Related