File:KleinBottle-cut.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 217 × 465 pixels, file size: 109 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Cut-away version of an immersion of a Klein bottle into .
Date
Source Own work
Author Nicoguaro
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

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


def x_(u, v):
    x = -2 + 2*cos(v) - cos(u)
    x[v<3*pi] = -2 + (2 + cos(u[v<3*pi]))*cos(v[v<3*pi])
    x[v<2*pi] = cos(u[v<2*pi])*(2.5 - 1.5*cos(v[v<2*pi]))
    return x

def y_(u, v):
    y = sin(u)
    y[v<2*pi] = sin(u[v<2*pi])*(2.5 - 1.5*cos(v[v<2*pi]))
    return y

def z_(u, v):
    z = -3*v + 12*pi
    z[v<3*pi] = (2 + cos(u[v<3*pi]))*sin(v[v<3*pi]) + 3*pi
    z[v<2*pi] = 3*v[v<2*pi] - 3*pi
    z[v<pi] = -2.5*sin(v[v<pi])
    return z

 
u = linspace(pi, 2*pi, 10)
v = linspace(0, 4*pi, 38)
u, v = np.meshgrid(u, v)

x = x_(u, v)
y = y_(u, v)
z = -z_(u, v)


fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap="YlGnBu_r", alpha=0.8,
                lw=1)
ax.set_xlim(-5, 5)
ax.set_ylim(-5, 5)
ax.set_zlim(-9, 1)
ax.view_init(azim=130, elev=30)
plt.axis("off")
plt.savefig("KleinBottle-cut.svg", bbox_inches="tight", transparent=True)
plt.show()

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current02:13, 18 February 2016Thumbnail for version as of 02:13, 18 February 2016217 × 465 (109 KB)Nicoguaro (talk | contribs)User created page with UploadWizard

The following page uses this file:

File usage on other wikis

The following other wikis use this file:

Metadata