The slope of a line: slope

### 11.14.8 The slope of a line: slope

The slope command takes as argument either a line, a line segment, or two points which determine a line.

slope returns the slope of the line.
Input:

slope(line(1,2i))

or:

slope(segment(1,2i))

or:

slope(1,2i)

Output:

-2

Input:

slope(line(x - 2y = 3))

Output:

1/2

Input:

slope(tangent(plotfunc(sin(x)),pi/4))

or:

slope(LineTan(sin(x),pi/4))

Output:

sqrt(2)/2

The slope command has slopeat and slopeatraw versions (see section 11.14.1).