Student[Precalculus] - Maple Programming Help

Home : Support : Online Help : Education : Student Package : Precalculus : Computation : Student/Precalculus/Line

Student[Precalculus]

 Line
 compute a line

 Calling Sequence Line(u, v, opts)

Parameters

 u - algebraic expression, list, or Vector v - algebraic expression, list, or Vector opts - (optional) equation(s) of the form option = value where option is one of lineoptions, output, pointoptions, title, and view; specify output options

Description

 • The Line(u, v) command computes the equation of the line, its slope, and the y- and x-intercepts from the data specified by u and v.  These values are returned in the form of an expression sequence; therefore, Line(1,2)[1] will obtain the equation of the line with slope $1$ and y-intercept $2$.
 – If u and v are both algebraic expressions then u is taken as the slope and v as the y-intercept of the line.
 – If one of u or v is an algebraic expression and the other is either a list of 2 algebraic values or a 2-D Vector with algebraic components, the algebraic expression is the slope and the list or Vector specifies a point on the line.
 – If u and v are both 2-element lists or 2-D Vectors with algebraic components then they are taken as points on the line. In this case, u and v must specify different points.
 • The Line(u, v, output = plot) command displays the graph of the line.
 • The optional parameters opts specify the desired output options for the resulting plot when output = plot. The available options are:
 lineoptions = list
 Specifies the plot options for the line.
 output = value or plot
 This options controls the return value of the function.
 * output = value computes the equation of the line, its slope, and the y- and x-intercepts.  The default is output=value.
 * output = plot displays a plot.  The data parameters u and v must be constant values when specifying this value.
 pointoptions = list containing plot options for points on the line
 Specifies the plot options for the points on the line.
 title = string
 Specifies the title to be displayed on the plot.
 view = list
 Specifies the x- and y-range of the plot.
 • For information on including additional plot option(s), see the plot help page.
 • For information on how to change the default colors, see the Student [SetColors] help page.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{Precalculus}]\right):$
 > $\mathrm{Line}\left(-1,2\right)$
 ${y}{=}{-}{x}{+}{2}{,}{-}{1}{,}{2}{,}{2}$ (1)
 > ${\mathrm{Line}\left(\left[1,1\right],-\frac{1}{2}\right)}_{1}$
 ${y}{=}{-}\frac{{1}}{{2}}{}{x}{+}\frac{{3}}{{2}}$ (2)
 > $\mathrm{Line}\left(\left[1,\frac{1}{2}\right],⟨4,1⟩\right)$
 ${y}{=}\frac{{1}}{{6}}{}{x}{+}\frac{{1}}{{3}}{,}\frac{{1}}{{6}}{,}\frac{{1}}{{3}}{,}{-}{2}$ (3)

Plot the line with slope -1 and y-intercept 2.

 > $\mathrm{Line}\left(-1,2,\mathrm{output}=\mathrm{plot},\mathrm{lineoptions}=\left[\mathrm{color}="Green"\right]\right)$