3.5.1 Draw a line : line
See also : ?? and ?? for line usage in
geometry and see ?? and ?? for axis.
line takes as argument cartesian(s) equation(s) :
in 2D: one line equation,
- in 3D: two plane equations.
line defines and draws the corresponding line.
the line 2*y+x-1=0
the horizontal line y=1
the vertical line x=1
the line x+2*y+1=0 in the plane z=2
the vertical line crossing through (1,1,0)
line defines an oriented line :
when the 2D line is given by an equation, it is rewritten
as "left_member-right_member=ax+by+c=0", this determinates
its normal vector [a,b] and the orientation is given by the vector
[b,-a]) (or its orientation is defined by the 3D cross product of its
normal vectors (with third coordinate 0) and the vector [0,0,1]).
For example line(y=2*x) defines the line -2x+y=0 with as direction
the vector [1,2] (or cross([-2,1,0],[0,0,1])=[1,2,0]).
- when the 3D line is given by two plane equations, it’s
direction is defined by the cross product of the normals to the planes
(where the plane equation is rewritten as
"left_member-right_member=ax+by+cz+d=0", so that
the normal is [a,b,c]).
For example the line(x=y,y=z) is the line x-y=0,y-z=0 and its
direction is :