     suivant: Draw an 2D horizontal monter: Graph of a line précédent: Graph of a line   Table des matières   Index

## 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.
Input :
line(2*y+x-1=0)
Output :
the line 2*y+x-1=0
Input :
line(y=1)
Output :
the horizontal line y=1
Input :
line(x=1)
Output :
the vertical line x=1
Input :
line(x+2*y+z-1=0,z=2)
Output :
the line x+2*y+1=0 in the plane z=2
Input :
line(y=1,x=1)
Output :
the vertical line crossing through (1,1,0)
Remark
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 :
cross([1,-1,0],[0,1,-1])=[1,1,1].     suivant: Draw an 2D horizontal monter: Graph of a line précédent: Graph of a line   Table des matières   Index
giac documentation written by Renée De Graeve and Bernard Parisse