I have the line that slope on some angle. How I can draw normal to the end of line?
Printable View
I have the line that slope on some angle. How I can draw normal to the end of line?
Not sure what you mean. Why don't you draw a picture and post it?
Well. How I can calculate normal vector to line?
A line has two normal vectors, pointing in opposite directions.
If you know the angle of the line (theta) in radians, the angles of the normal vectors are:
theta+PI/2
theta-PI/2
Or if you know the slope of the line (m), the slope of the normal line is -1/m.
Is there a way avoid to calculate angles? I need just normalized normal vector (i e vector that has length 1).
How is your line defined? Is it a line segment formed by two points?
Of course yes. B/c I need to draw its with Flash draw API.
If you points are A and B, your normals are:
<By-Ay, Ax-Bx>
<Ay-By, Bx-Ax>
Great thanks!