Line Equation with angle

前端 未结 5 1763
逝去的感伤
逝去的感伤 2020-12-13 06:36

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)?

5条回答
  •  别那么骄傲
    2020-12-13 07:05

    You'll want to draw it from (0, 0) to (x_length, tan(angle)*x_length). The gradient will be tan(angle). You can adjust this for a different starting point by subtracting everything from that starting point.

提交回复
热议问题