πŸ–ŒοΈ Visualization of surfaces and curvesΒΆ

With this small project, you can learn how to visualize surfaces and curves in three-dimensions using Python.

Before startΒΆ

Install Python and learn basic skill of it.

Python is a very (probably the most) useful programming language for general purpose programming. You’d better learn it ASAP if you want to keep up-to-date.

StepsΒΆ

Step #1ΒΆ

Install numpy, matplotlib packages for your Python using command

$ pip install numpy
$ pip install matplotlib

Step #2ΒΆ

Download the Python scripts to be used be clicking on:

You will see the following functions in these scripts. Study the scripts carefully to learn how to use them to plot curves or surfaces.

Plot a curve in three-dimensions.

curve.curve(x, y, z, t_range)[source]ΒΆ

Plot a curve in three-dimensions.

Parameters:
  • x – the x(t) parametric function.

  • y – the y(t) parametric function.

  • z – the z(t) parametric function.

  • t_range – the range of the parameter t.

Plot a surface in three-dimensions.

surface.surface(z, x_range, y_range)[source]ΒΆ

Plot a surface in three-dimensions.

Parameters:
  • z –

    The function that represents the surface.

    If you have the equation of the figure in the form

    F(x, y, z) = 0,

    You should first re-write it into the form

    z(x, y) = 0.

  • x_range – The range of x-coordinates.

  • y_range – The range of y-coordinates.


↩️ Back to 🧩 Workshop.

🏠️ Back to Math is cheap.