If I got your question right, you want to draw something like a stairs. I will assume that one of the lines has an equation
a x + b y + c = 0
with nonzero a
and b
(special cases a=0
or b=0
are trivial). I will also assume that a^2+b^2=1
(if not, just divide the equation by 1/sqrt(a^2+b^2)
).
Then if have the lengths of your lines L
, and the coordinate of starting point is (x0,y0)
, then coordinates of other points, where perpendicular lines start are
(x_i, y_i) = ( x0 + (b L i)/(N-1), y0 - (a L i)/(N-1) )
where i
runs fro 0
to N-1
, and N
is the number of points, that you need for your staircase.
Note: if points will go in the wrong direction, use the opposite sign
(x_i, y_i) = ( x0 - (b L i)/(N-1), y0 + (a L i)/(N-1) )
After you have points, where the perpendicular lines start, the parametric equations for each perpendicular line is
x_i(t) = x_i + a t D, y_i(t) = y_i + b t D
where t
changes from 0
to 1
and D
is the distance between your parallel lines.
Note: if perpendicular lines go to the wrong direction, change sign
x_i(t) = x_i - a t D, y_i(t) = y_i - b t D
That is more or less it)
1Do you have a question? – Phlamajam – 2015-11-18T13:38:22.953
how can i draw these lines? – Kivanc Basak – 2015-11-18T13:44:08.580
I think that this question is off topic here. http://superuser.com/help/on-topic You will get more answers if you ask in the correct place.
– Katu – 2015-11-18T15:18:51.543