Contour of a paraboloid on a coarse grid

A student plots a contour of the paraboloid z=x2+y2z = x^2 + y^2 on a deliberately coarse grid:


Python
x = np.linspace(-2, 2, 5)
y = np.linspace(-2, 2, 5)
X, Y = np.meshgrid(x, y)
Z = X**2 + Y**2
ax.contour(X, Y, Z, levels=[2])


Matplotlib locates a contour by linear interpolation of Z along the edges between neighbouring grid points. Find:

  • the largest value stored in Z;
  • the number of grid points where Z is strictly less than 2;
  • the radius of the exact level curve x2+y2=2x^2 + y^2 = 2, to two decimal places;
  • the x-coordinate where the drawn level-2 contour crosses the positive x-axis, to two decimal places.
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Creating Specialized and Three Dimensional Plots Questions: