Student[MultivariateCalculus] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Multivariate Calculus : Lines and Planes : Student/MultivariateCalculus/Line

Student[MultivariateCalculus]

 Line
 Create and initialize a line object

 Calling Sequence Line(eqn, opts) Line(expr, opts) Line(eqn1, eqn2, opts) Line(expr1, expr2, opts) Line(vt, opts) Line(eqnlst, opts) Line(exprlst, opts) Line(p1, v, opts) Line(v, pt, opts) Line(p1, p2, opts) Line(p1, P1, opts) Line(P1, p1, opts) Line(P1, P2, opts) Line(ln, opts)

Parameters

 eqn - Linear equation of a line in 2D expr - Linear expression, equated to 0 to get a line in 2D eqn1, eqn2 - Equations of two intersecting planes expr1, expr2 - Expressions which, when equated to 0, define two intersecting planes vt - Vector defining a generic point on the line parametrically eqnlst - List of parametric equations, defining a generic point on the line exprlst - List of parametric expressions, defining a generic point on the line p1, p2 - Points on the line, specified as lists of coordinates v - Direction Vector of the line P1, P2 - Plane defined by Student[MultivariateCalculus] ln - Existing Line object opts - (optional) equations controlling the representation or the plot of the line

Options

 • The opts arguments can contain one or more of the following options.
 • parameter = name
 The variable name used in the parametric form. This is used in interpreting the parametric forms of the call to the Line function, when obtaining the parametric form of the line using the GetRepresentation command, and with eval as explained above. The default is $t$.
 • variables = list
 The variables to be used in the line's equation.  This is used in interpreting the equation and expression forms of the call to the Line function, and when obtaining equations for the line. The default is $\left[x,y,z\right]$.
 • id = positive integer, name, or string
 Lines display as $\mathrm{<< Line n >>}$, where $n$ is an identification for the line that is by default a positive integer assigned in order of creation. The id option can be used to force the line to be given a different identification. It is an error to use the same identification for two different lines that are both in use.

Description

 • The Line command creates a line object that can be operated on or graphed. The line can be in two- or three-dimensional space.
 • Lines can be specified in the following ways:
 – A linear equation eqn, such as $ax+by+c=0$, defining a line in two-dimensional space.
 – An expression expr of the form $ax+by+c$, which is set equal to 0 to obtain a line in two-dimensional space.
 – Two linear equations, eqn1 and eqn2, such as $ax+by+cz+d=0$, which together define a line in three-dimensional space.
 – Two linear expressions, expr1 and expr2, such as $ax+by+cz+d$, which are set equal to 0 to obtain a line in three-dimensional space.
 – A Vector vt specifying the line in parametric form, such as $⟨2,3⟩+t·⟨4,5⟩$ or $⟨2+4t,3+5t,1-2t⟩$.
 – A list eqnlst of parametric equations, such as $\left[x=2,y=3-t,z=2t\right]$.
 – A list exprlst of parametric equations, such as $\left[2,3-t,2t\right]$.
 – A point p1, such as $\left[1,2,3\right]$, and a nonzero Vector v, such as $⟨2,-1,0⟩$, giving a point on the line and the direction of the line, respectively. The point and direction can also be specified in the other order.
 – Two different points p1 and p2 on the line, such as $\left[1,2\right]$ and $\left[3,1\right]$.
 – A point p1, such as $\left[1,2,3\right]$, and a Plane object P1 defined earlier, such as $\mathrm{Plane}\left(\left[2,4,5\right],⟨2,-1,0⟩\right)$. The line this defines is the one that contains p1 and is normal to P1. The point and plane can also be specified in the other order.
 – Two intersecting Plane objects P1 and P2 defined earlier, such as $\mathrm{Plane}\left(\left[2,4,5\right],⟨2,-1,0⟩\right)$ and $\mathrm{Plane}\left(\left[2,-1,0\right],⟨2,4,5⟩\right)$. The line this defines is the intersection between P1 and P2.
 – A line ln defined earlier, such as $\mathrm{Line}\left(\left[1,2\right],\left[3,1\right]\right)$. (This can be useful to change the names of the coordinate variables and the parameter, using the options explained below.)
 • It is possible to specify two mathematically identical lines using different Line commands.
 • The coefficients and coordinates defining a Line can contain parameters. For example, we can define a line containing the points $\left[2,3,a\right]$ and $\left[1,a+b,3\right]$ with the command $\mathrm{Line}\left(\left[2,3,a\right],\left[1,a+b,3\right]\right)$.
 These parameters must be different from the coordinate variables (set by the variables option explained below; by default $\left[x,y\right]$ or $\left[x,y,z\right]$), and different from the parameter used for the parametric form of the line (set by the parameter option explained below; by default $t$).
 • The following is a list of commands available to Line objects:

 • In addition, there is some special behavior for the eval command when applied to a Line. If the line contains parameters, as in the example $\mathrm{Line}\left(\left[2,3,a\right],\left[1,a+b,3\right]\right)$ above, then one can use eval to substitute values for those parameters. For example, we might evaluate the line given above at $a=2$ to obtain the line through the points $\left[2,3,2\right]$ and $\left[1,b+2,3\right]$.
 Another possibility is to evaluate at a value for the parameter used for the parametric form of the line (set by the parameter option explained below; the default is $t$). This will return the point one obtains for the given value of the parameter. For example, a line defined as $\mathrm{Line}\left(⟨1,0,-1⟩+t·⟨3,-1,2⟩\right)$ can be evaluated at $t=2$ to obtain the point $\left[7,-2,3\right]$.
 Finally, one can rename the coordinate variables using eval: if one evaluates the line above at $\left[x=u,z=v\right]$, then one obtains an identical line in the space with coordinates $u$, $y$, and $v$.

Examples

 > $\mathrm{with}\left({\mathrm{Student}}_{\mathrm{MultivariateCalculus}}\right):$

Lines in 2D

 > $\mathrm{l1}≔\mathrm{Line}\left(4x-3y=10\right):$$\mathrm{GetRepresentation}\left(\mathrm{l1}\right)$
 ${t}{·}\left[\begin{array}{c}{3}\\ {4}\end{array}\right]{+}\left[\begin{array}{c}\frac{{8}}{{5}}\\ {-}\frac{{6}}{{5}}\end{array}\right]$ (1)
 > $\mathrm{l2}≔\mathrm{Line}\left(4x-3y-8\right):$$\mathrm{GetRepresentation}\left(\mathrm{l2}\right)$
 ${t}{·}\left[\begin{array}{c}{3}\\ {4}\end{array}\right]{+}\left[\begin{array}{c}\frac{{32}}{{25}}\\ {-}\frac{{24}}{{25}}\end{array}\right]$ (2)
 > $\mathrm{l3}≔\mathrm{Line}\left(⟨2,3⟩+\mathrm{.}\left(t,⟨4,5⟩\right),'\mathrm{id}=\mathrm{l3}'\right):$$\mathrm{GetRepresentation}\left(\mathrm{l3}\right)$
 ${t}{·}\left[\begin{array}{c}{4}\\ {5}\end{array}\right]{+}\left[\begin{array}{c}{2}\\ {3}\end{array}\right]$ (3)

Note how lines $\mathrm{l1}$ and $\mathrm{l2}$ are displayed using their automatically assigned identification, but $\mathrm{l3}$ has the explicitly specified identification l3:

 > $\mathrm{l1},\mathrm{l2},\mathrm{l3}$
 ${\mathrm{<< Line 1 >>}}{,}{\mathrm{<< Line 2 >>}}{,}{\mathrm{<< Line l3 >>}}$ (4)
 > $\mathrm{l4}≔\mathrm{Line}\left(\left[1,2\right],⟨4,5⟩\right):$$\mathrm{GetRepresentation}\left(\mathrm{l4}\right)$
 ${t}{·}\left[\begin{array}{c}{4}\\ {5}\end{array}\right]{+}\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (5)
 > $\mathrm{l5}≔\mathrm{Line}\left(\left[3,0\right],\left[-1,5\right]\right):$$\mathrm{GetRepresentation}\left(\mathrm{l5}\right)$
 ${t}{·}\left[\begin{array}{c}{-4}\\ {5}\end{array}\right]{+}\left[\begin{array}{c}{3}\\ {0}\end{array}\right]$ (6)

Lines in 3D

 > $\mathrm{l6}≔\mathrm{Line}\left(4x-3y+2z=10,2x+y=-5\right):$$\mathrm{GetRepresentation}\left(\mathrm{l6}\right)$
 ${t}{·}\left[\begin{array}{c}{-2}\\ {4}\\ {10}\end{array}\right]{+}\left[\begin{array}{c}{-}\frac{{3}}{{4}}\\ {-}\frac{{7}}{{2}}\\ \frac{{5}}{{4}}\end{array}\right]$ (7)
 > $\mathrm{l7}≔\mathrm{Line}\left(4x-3y+2z-8,2x+y+3\right):$$\mathrm{GetRepresentation}\left(\mathrm{l7}\right)$
 ${t}{·}\left[\begin{array}{c}{-2}\\ {4}\\ {10}\end{array}\right]{+}\left[\begin{array}{c}{-}\frac{{17}}{{60}}\\ {-}\frac{{73}}{{30}}\\ \frac{{11}}{{12}}\end{array}\right]$ (8)
 > $\mathrm{l8}≔\mathrm{Line}\left(⟨4,5,-2⟩,\left[2,3,1\right],'\mathrm{parameter}'=k\right):$$\mathrm{GetRepresentation}\left(\mathrm{l8}\right)$
 ${k}{·}\left[\begin{array}{c}{4}\\ {5}\\ {-2}\end{array}\right]{+}\left[\begin{array}{c}{2}\\ {3}\\ {1}\end{array}\right]$ (9)
 > $\mathrm{l9}≔\mathrm{Line}\left(\left[u=a+1,v=2-2a,w=a\cdot 3\right]\right):$$\mathrm{GetRepresentation}\left(\mathrm{l9}\right)$
 ${a}{·}\left[\begin{array}{c}{1}\\ {-2}\\ {3}\end{array}\right]{+}\left[\begin{array}{c}{1}\\ {2}\\ {0}\end{array}\right]$ (10)
 > $\mathrm{l10}≔\mathrm{Line}\left(\left[a+b,2-2a-b,a\cdot 3\right],'\mathrm{parameter}'=a,'\mathrm{variables}'=\left[u,v,w\right]\right):$$\mathrm{GetRepresentation}\left(\mathrm{l10}\right)$
 ${a}{·}\left[\begin{array}{c}{1}\\ {-2}\\ {3}\end{array}\right]{+}\left[\begin{array}{c}{b}\\ {2}{-}{b}\\ {0}\end{array}\right]$ (11)
 > $\mathrm{l11}≔\mathrm{Line}\left(\left[1,2,3\right],\mathrm{Plane}\left(\left[2,4,5\right],⟨2,-1,0⟩\right)\right):$$\mathrm{GetRepresentation}\left(\mathrm{l11}\right)$
 ${t}{·}\left[\begin{array}{c}{2}\\ {-1}\\ {0}\end{array}\right]{+}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (12)
 > $\mathrm{l12}≔\mathrm{Line}\left(\mathrm{Plane}\left(\left[2,4,5\right],⟨2,-1,0⟩\right),\mathrm{Plane}\left(\left[2,-1,0\right],⟨2,4,5⟩\right),'\mathrm{variables}'=\left[u,v,w\right]\right):$$\mathrm{GetRepresentation}\left(\mathrm{l12}\right)$
 ${t}{·}\left[\begin{array}{c}{-5}\\ {-10}\\ {10}\end{array}\right]{+}\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]$ (13)
 > $\mathrm{l13}≔\mathrm{Line}\left(\mathrm{l9},'\mathrm{variables}'=\left[x,y,z\right],'\mathrm{parameter}'=k\right):$$\mathrm{GetRepresentation}\left(\mathrm{l13}\right):$

Some previously defined lines in other standard forms.

 > $\mathrm{GetRepresentation}\left(\mathrm{l4},'\mathrm{form}'='\mathrm{parametric}'\right)$
 $\left[{x}{=}{1}{+}{4}{}{t}{,}{y}{=}{2}{+}{5}{}{t}\right]$ (14)
 > $\mathrm{GetRepresentation}\left(\mathrm{l5},'\mathrm{form}'='\mathrm{vectors}'\right)$
 ${t}{·}\left[\begin{array}{c}{-4}\\ {5}\end{array}\right]{+}\left[\begin{array}{c}{3}\\ {0}\end{array}\right]$ (15)
 > $\mathrm{GetRepresentation}\left(\mathrm{l5},'\mathrm{form}'='\mathrm{combined_vector}'\right)$
 $\left[\begin{array}{c}{3}{-}{4}{}{t}\\ {5}{}{t}\end{array}\right]$ (16)

eval can be used for substituting the unknowns and the free variable of the vector form.

 > $\genfrac{}{}{0}{}{\mathrm{l9}}{\phantom{'a'=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{l9}}}{'a'=0};$$\genfrac{}{}{0}{}{\mathrm{l13}}{\phantom{'k'=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{l13}}}{'k'=0}$
 $\left[{1}{,}{2}{,}{0}\right]$
 $\left[{1}{,}{2}{,}{0}\right]$ (17)
 > $\genfrac{}{}{0}{}{\mathrm{l10}}{\phantom{a=3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{l10}}}{a=3}$
 $\left[{b}{+}{3}{,}{-}{4}{-}{b}{,}{9}\right]$ (18)
 > $\mathrm{l14}≔\genfrac{}{}{0}{}{\mathrm{l10}}{\phantom{b=3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{l10}}}{b=3};$$\mathrm{GetRepresentation}\left(\mathrm{l10}\right)$
 ${\mathrm{l14}}{≔}{\mathrm{<< Line 13 >>}}$
 ${a}{·}\left[\begin{array}{c}{1}\\ {-2}\\ {3}\end{array}\right]{+}\left[\begin{array}{c}{b}\\ {2}{-}{b}\\ {0}\end{array}\right]$ (19)
 > $\mathrm{eval}\left(\mathrm{l10},\left[a=3,b=3\right]\right)$
 $\left[{6}{,}{-7}{,}{9}\right]$ (20)

Query the properties of individual lines.

 > $\mathrm{GetDirection}\left(\mathrm{l1}\right)$
 $\left[\begin{array}{c}{3}\\ {4}\end{array}\right]$ (21)
 > $\mathrm{GetDirection}\left(\mathrm{l3}\right)$
 $\left[\begin{array}{c}{4}\\ {5}\end{array}\right]$ (22)
 > $\mathrm{GetDirection}\left(\mathrm{l10}\right)$
 $\left[\begin{array}{c}{1}\\ {-2}\\ {3}\end{array}\right]$ (23)
 > $\mathrm{GetPoint}\left(\mathrm{l4}\right)$
 $\left[{1}{,}{2}\right]$ (24)
 > $\mathrm{GetPoint}\left(\mathrm{l8}\right)$
 $\left[{2}{,}{3}{,}{1}\right]$ (25)

Determine the relationship between two lines.

 > $\mathrm{GetIntersection}\left(\mathrm{l1},\mathrm{l3}\right)$
 $\left[{46}{,}{58}\right]$ (26)

These two lines have no intersection.

 > $\mathrm{GetIntersection}\left(\mathrm{l1},\mathrm{l2}\right)$
 ${\varnothing }$ (27)
 > $\mathrm{AreParallel}\left(\mathrm{l6},\mathrm{l7}\right)$
 ${\mathrm{true}}$ (28)
 > $\mathrm{AreParallel}\left(\mathrm{l6},\mathrm{l8}\right)$
 ${\mathrm{false}}$ (29)
 > $\mathrm{AreSkew}\left(\mathrm{l6},\mathrm{l8}\right)$
 ${\mathrm{true}}$ (30)
 > $\mathrm{Distance}\left(\mathrm{l6},\mathrm{l8}\right)$
 $\frac{{81}{}\sqrt{{1334}}}{{2668}}$ (31)
 > $\mathrm{evalf}\left(\right)$
 ${1.108860998}$ (32)

Compatibility

 • The Student[MultivariateCalculus][Line] command was introduced in Maple 17.