How Do I
This help page is intended as a guide to the commands available in Maple for plotting straight lines. You can plot a line with the commands plottools[line] and plot. With the commands Student[MultivariateCalculus][Line] and geometry[line], you can define a line and then work with it.

The plottools[line] Command


Use the plottools:line command to plot a line segment. The plottools:line command creates a plot data object, which can then be displayed, possibly in combination with other plot objects, with the plot:display command.
For more information, see plottools[line].

Example


>

display(line([0,0], [3,4], color=blue));




The Plot Command


Use the plot command to plot an expression that represents a line over an interval.
For more information on the plot command, see plot. For more information on plot command options, see plot,options.

Example: Using the Plot Command


>

$\mathrm{plot}\left({\mathrm{x}}^{}\+7\,xequals;10..10\right)semi;$



Example: Using the Context Menu System


Follow the steps below to plot the function $y\={x}^{}\+7$.
Step

Description

Illustration

1

Type $y\={x}^{}\+7$.


2

Rightclick the equation, and from the Context Menu, select Plots > 2D Plot of Right Side.






Example: Using the Interactive Plot Builder


Follow the steps below to plot the function $y\={x}^{}\+7$.
Step

Description

Illustration

1

Type the expression $x\+7$. Do not type an equation, since the Plot Builder interprets equations as implicit plots.


2

Rightclick the expression, and from the Context Menu, select Plots > Plot Builder. The Plot Builder dialog opens. Note that if the Plot Builder is accessed from the main menu (Tools > Assistants > Plot Builder...), then the expression $xplus;7$ must be entered manually.


3

The plot type and plot ranges for independent variables can be set here. Options opens a window where the settings for this plot can be changed. For this example, the default settings suffice.


4

Click Plot. The plot is displayed.






Example: Plotting a Horizontal Line


>

$\mathrm{plot}\left(5\right)$



Example: Plotting a Vertical Line


Example 1: Using the plot command to plot x=5
This line cannot be obtained as the graph of a function, so Maple's plot command will not graph the vertical line without user intervention. Here, a portion of the line is drawn as a line segment, with the line segment represented by the parametric curve $x\left(t\right)\=5\,y\left(t\right)equals;tperiod;$
For more information on plotting vertical lines, see MaplePortal,PlottingTips.
>

$\mathrm{plot}\left(\left[5\,t\,tequals;10..10\right]\right)$


Note for nonWindows users: The keystrokes given in this document are for Windows. There will be differences for other platforms. If you are using a different platform, see Help>Quick Help for the list of the most common keystrokes.


Student[MultivariateCalculus][Line]


The Student[MultivariateCalculus][Line] command is available to all Maple users, although primarily intended for use by students and instructors of courses on multivariate calculus, as these courses typically start with lectures on vectors, lines, and planes.
Use the Student[MultivariateCalculus][Line] command to create a line object. The Student[MultivariateCalculus] package contains many commands for interacting with line objects.
For more information about the Line command, see Student[MultivariateCalculus][Line]. For more information about the Student[MultivariateCalculus] subpackage, see Student[MultivariateCalculus].

Example


>

$\mathrm{with}\left(\mathrm{Student}\left[\mathrm{MultivariateCalculus}\right]\right)\:$

>

$\mathrm{l1}\u2254\mathrm{Line}\left(xyequals;7\right)colon;$

>

$\mathrm{l2}\u2254\mathrm{Line}\left(4\cdot x5\cdot y\=20\right)\:$

>

$\mathrm{GetIntersection}\left(\mathrm{l1}\,\mathrm{l2}\right)$

$\left[{}{55}{\,}{}{48}\right]$
 (3.1.1) 



The geometry[line] Command


The geometry[line] command enables you to work in 2D Euclidean geometry. With this command you can create directed line segment objects and line objects. You can interact with these objects though some of the other commands offered in the geometry package. The table below provides a quick summary of commands available for use with each type of object:
Object

Available commands

line segment

CrossProduct, midpoint, OnSegment;

line

AreConcurrent, AreParallel, ArePerpendicular, Equation, FindAngle, ParallelLine, PerpenBisector, PerpendicularLine, slope



For more information, see geometry[line].

Example


>

$\mathrm{line}\left(\mathrm{l3}\,xplus;yequals;1comma;\left[xcomma;y\right]\right)comma;\mathrm{line}\left(\mathrm{l4}comma;2\cdot xplus;yequals;7comma;\left[xcomma;y\right]\right)colon;$

>

$\mathrm{intersection}\left(Q\,\mathrm{l3}comma;\mathrm{l4}comma;\mathrm{B}\right)semi;$

>

$\mathrm{detail}\left(Q\right)$

$\begin{array}{ll}{\text{name of the object}}& {Q}\\ {\text{form of the object}}& {\mathrm{point2d}}\\ {\text{coordinates of the point}}& \left[{6}{\,}{\mathrm{5}}\right]\end{array}$
 (4.1.2) 



Related Topics


The How Do I... topics cover the essentials for doing mathematics in Maple. Learn more about available tools and features, such as palettes and contextsensitive menus.
Refer to Help>Quick Reference for basic Getting Started tips.





