File:Gaussian curvature.svg

Summary

Description
English: From left to right: a surface of negative Gaussian curvature (hyperboloid), a surface of zero Gaussian curvature (cylinder), and a surface of positive Gaussian curvature (sphere).
Español: De izquierda a derecha: una superficie con curvatura gaussiana negativa (hiperboloide), una superficie con curvatura gaussiana cero (cilindro), y una superficie con curvatura gaussiana positiva (esfera).
Date
Source Own work
Author Nicoguaro
SVG development
InfoField

Creation

This file was created with Python, SciPy, NumPy and Matplotlib. It was later modified using Inkscape.

from __future__ import division
import numpy as np
from numpy import pi, cos, sin, sqrt, outer, ones
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection='3d')
u = np.linspace(0, 2 * pi, 100)
v = np.linspace(0, pi, 100)
one_v = ones(100)


# Sphere
x1 = 10 * outer(cos(u), sin(v))
y1 = 10 * outer(sin(u), sin(v)) + 17
z1 = 10 * outer(one_v, np.cos(v))
ax.plot_surface(x1, y1, z1, rstride=5, cstride=5, cmap='Spectral',
                linewidth=0.5)

# Cylinder
x2 = 6 * outer(cos(u), one_v)
y2 = 6 * outer(sin(u), one_v)
z2 = 20 * outer(one_v, v/pi - 0.5)
ax.plot_surface(x2, y2, z2, rstride=5, cstride=5, cmap='Spectral',
                linewidth=0.5)

# Hyperboloid
v = 2*v/pi - 1
x3 = 6 * outer(cos(u), sqrt(1 + v**2))
y3 = 6 * outer(sin(u), sqrt(1 + v**2)) - 16
z3 = 12 * outer(one_v, v)
ax.plot_surface(x3, y3, z3, rstride=5, cstride=5, cmap='Spectral',
                linewidth=0.5)

# Fix aspect ratio and axes details
ax.set_xlim(-13, 13)
ax.set_ylim(-13, 13)
ax.set_zlim(-13, 13)
ax.view_init(elev=35, azim=-45)
plt.axis('off')
plt.savefig('Gaussian curvature.svg', transparent=True)
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Gaussian%20curvature.svgCategory:Self-published work
Category:Differential geometry of surfaces Category:Gaussian curvature Category:NumPy Category:Surfaces of revolution Category:Geometry images with transparent background Category:SVG surface plots
Category:CC-Zero Category:Differential geometry of surfaces Category:Gaussian curvature Category:Geometry images with transparent background Category:NumPy Category:SVG surface plots Category:Self-published work Category:Surfaces of revolution Category:Valid SVG created with Matplotlib