The slope of a line is most commonly quoted as the "rise over the run." More precisely, this means
the $\Delta y$ over $\Delta x$, or $m=\Delta y/\Delta x$, where $m$ is commonly assigned to be
the "slope." Now, do you remember how the slope works? Does a vertical line have an infinite slope
or a zero slope? What about a horiztonal line? What about a $45^\circ$ line? Which lines
have negative slopes?

In this lesson, you will be able to investigate these properties of the slope, by drawing any line of your choice with two mouse clicks, like was done in this lesson.

When you get the code below to work, click once, then click again to draw a line. The program will compute and tell you $\Delta y$, $\Delta x$, and the slope of your line. See if you can answer the questions posed above.

Type your code here:

See your results here:

This code will not run. You have to fix three things. First, the

`dy=`

line which is supposed
to be $\Delta y$, which here is $y_2-y_1$. Second is the `dx=`

line which is supposed to
be $\Delta x$ which here is $x_2-x_1$. Finally, you need to fix the `m=`

line to compute the slope
of the mouse-clicked line which is $\Delta y/\Delta x$. Can you do it?
Dismiss.
Does your code work? Want to run it on your iPhone?

Here's your code:

- Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.
- Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into
this page
- Then click the "Use on iPhone" button that you'll see.