# Cylinders and Quartic Surfaces

## 4603 days ago by pub

# Set up variables var('u v')
 (u, v) (u, v)

Many of the surfaces that we are drawing are not of the form

z = f(x, y),
so I am defining the surfaces parametrically, like we did with lines. Don't worry if you don't understand where I got the parametric equations from: we will talk more about parametric surfaces later in the semester.

## Right Circular Cylinder

x^2 + y^2 = 1
x = cos(u) y = sin(u) z = v parametric_plot3d([x, y, z], (u, 0, 2 * pi), (v, -2, 2), mesh = True, aspect_ratio = [1, 1, 1])

## Parabolic Cylinder

z = x^2
x = u y = v z = u^2 parametric_plot3d([x, y, z], (u, -2, 2), (v, -2, 2), mesh = True, aspect_ratio = [1, 1, 1])

## Ellipsoid

x^2 + y^2 / 9 + z^2 / 4 = 1
x = cos(u) * sin(v) y = 3 * sin(u) * sin(v) z = 2 * cos(v) parametric_plot3d([x, y, z], (u, 0, 2 * pi), (v, 0, pi), mesh = True, aspect_ratio = [1, 1, 1])

## Elliptic Paraboloid

z / 4 = x^2 + y^2 / 4
x = u * cos(v) y = 2 * u * sin(v) z = 4 * (x^2 + y^2 / 4) parametric_plot3d([x, y, z], (u, 0, 1), (v, 0, 2 * pi), mesh = True, aspect_ratio = [1, 1, 1])

## Hyperbolic Paraboloid

z = y^2 - x^2
plot3d(v^2 - u^2, (u, -1, 1), (v, -1, 1), mesh = True, aspect_ratio = [1, 1, 1])

## Hyperboloid of One Sheet

x^2 / 4 + y^2 - z^2 / 4 = 1
x = 2 * cos(u) * cosh(v) y = sin(u) * cosh(v) z = 2 * sinh(v) parametric_plot3d([x, y, z], (u, 0, 2 * pi), (v, -1, 1), mesh = True, aspect_ratio = [1, 1, 1])

## Hyperboloid of Two Sheets

- x^2 + y^2 / 4 - z^2 / 4 = 1
x = cos(u) * sinh(v) y = 2 * cosh(v) z = 2 * sin(u) * sinh(v) parametric_plot3d([[x, y, z], [x, -y, z]], (u, 0, 2 * pi), (v, -1, 1), mesh = True, aspect_ratio = [1, 1, 1])

## Cone

z^2 = x^2 + y^2 / 4
x = v * cos(u) y = v * 2 * sin(u) z = v parametric_plot3d([x, y, z], (u, 0, 2 * pi), (v, -2, 2), mesh = True, aspect_ratio = [1, 1, 1])