## Description

Here we will discuss certain problems that arise when plotting an exponential spiral and a lemniscate.

#### Exponential Spiral

Exponential spirals of large domains require a larger amount of plot points to be specified to produce a smooth curve. Compare this cell, which produces a spiral with the default 200 points using the function

(1)The plot looks polygonal due to the large domain of the function. Sage draws curves by creating a piecewise linear function of a default amount of 200 points. 200 points out of a domain of $14\pi$ results in about 4.5 points per radian, not enough to produce a smooth curve. To remedy this, we will manually set `plot_points` to a larger value: 10,000.

Note how much smoother the curve is, as we now have about 227.3 points per radian

#### Code

```
theta = var('theta')
polar_plot(exp(theta/10), (theta, -12*pi, 2*pi))
```

```
theta = var('theta')
polar_plot(exp(theta/10), (theta, -12*pi, 2*pi), plot_points=10000)
```

#### Lemniscates

Due to certain properties of functions which produce this shape and their derivatives plotting will often go awry, regardless of the amount of points set. Compare the graphs of a lemniscate plotted with 200 points and one with 10000 points using this function:

(2)#### Code

```
theta = var('theta')
polar_plot(3*sqrt(cos(2*theta)), (theta, -6*pi, 6*pi))
```

```
theta = var('theta')
polar_plot(3*sqrt(cos(2*theta)), (theta, -6*pi, 6*pi), plot_points=10000)
```

## Sage Cell

Primary Tags:

Secondary Tags:

A list of possible tags can be found at The WeBWorK Open Problem Library. For linear algebra tags see the Curated Courses Project.

## Options

Any related cells go here. Provide a link to the page containing the information about the cell.

## Tags

Permalink:

Author: Gregory V. Bard. *Sage for Undergraduates.* American Mathematical Society, Providence, RI, 2015. Available at http://www.gregorybard.com/Sage.html.

## Related Cells

## Attribute

Date: 28 Feb 2019 21:10

Submitted by: Zane Corbiere