spinning all kinds of 3-dimensional objects in terminal. Any comments, Issues, Pull Requests are always welcome.
All descriptions are commented in donuts.c.
gcc -o donut donut.c
./donut
Then, experimentally manipulate the terminal size.
Reference: https://www.a1k0n.net/2011/07/20/donut-math.html
gcc -o sphere sphere.c
./sphere
All except following features are same as the donut.
- I made a sphere of radius R from the point (RS, RS, 0). Refer to sphere.c for variable descriptions.
- Then I rotated the sphere about x-axis and z-axis.
- Each coordinate (x, y, z) is obtained by the parametric equation of sphere * parallel translation matrix * rotation matrix.