File:Torus cycles.svg

Original file ‎(SVG file, nominally 512 × 780 pixels, file size: 46 KB)

Summary

Description
English: Homology cycles on a torus. Radius of magenta circle is and radius of red circle is . Image created in python and subsequently cropped and rotated manually using a text editor.
Date
Source Own work
Author Krishnavedala
Other versions
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

Source code
from mpl_toolkits.mplot3d import axes3d
from matplotlib.patches import Circle
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.art3d as art3d
import numpy as np

R, r = 15, 5

def get_x(phi, theta):
    global r, R
    return (R + r * np.cos(phi)) * np.cos(theta)

def get_y(phi, theta):
    global r, R
    return (R + r * np.cos(phi)) * np.sin(theta)

def get_z(phi, theta):
    global r
    return r * np.sin(phi)

if __name__ == "__main__":
    fig = plt.figure(figsize=(10,10))
    ax = fig.add_subplot(111, projection='3d')

    ph = th = np.linspace (-np.pi, np.pi,30)
    phi, theta = np.meshgrid (ph, th)

    x = np.array([get_x(p,t) for p,t in zip(np.ravel(phi), np.ravel(theta))])
    X = x.reshape(phi.shape)
    y = np.array([get_y(p,t) for p,t in zip(np.ravel(phi), np.ravel(theta))])
    Y = y.reshape(phi.shape)
    z = np.array([get_z(p,t) for p,t in zip(np.ravel(phi), np.ravel(theta))])
    Z = z.reshape(phi.shape)
    C1 = Circle( (R,0), radius=r, fc='none', ec='red')
    C2 = Circle( (0,0), radius=R, fc='none', ec='magenta')

    ax.plot_wireframe(X, Y, Z, color='#CCCCCC')
    ax.add_patch(C1)
    ax.add_patch(C2)
    art3d.pathpatch_2d_to_3d(C1, z=0, zdir='y')
    art3d.pathpatch_2d_to_3d(C2, z=r, zdir='z')

    ax.set_xlim3d(-20,20)
    ax.set_ylim3d(-20,20)
    ax.set_zlim3d(-20,20)
    ax.set_xlabel('X')
    ax.set_ylabel('Y')
    ax.set_zlabel('Z')
    ax.set_axis_off()

    ax.view_init(elev=30, azim=-45)
    plt.show()
    plt.savefig('torus.svg', bbox_inches='tight', pad_inches=.15, \
        bbox_extra_artists=[C1,C2], transparent='true')

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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

creator

some value

URL: https://commons.wikimedia.org/wiki/user:Krishnavedala
Wikimedia username: Krishnavedala
author name string: Krishnavedala

copyright status

copyrighted, dedicated to the public domain by copyright holder

copyrighted

copyright license

Creative Commons CC0 License

source of file

original creation by uploader

inception

14 April 2014

File history

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

Date/TimeThumbnailDimensionsUserComment
current16:38, 14 April 2014512 × 780 (46 KB)Krishnavedala
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file:

  • Usage on bs.wikipedia.org
    • Torus
  • Usage on ca.wikipedia.org
    • Conjectura de Poincaré
  • Usage on cv.wikipedia.org
    • Тор (çий)
  • Usage on de.wikipedia.org
    • Torus
    • Holomorphe Funktion
    • Sphärenbündel
    • Riemannsches Produkt
    • Benutzer:Carlos-X/Dump2
  • Usage on el.wikipedia.org
    • Τόρος
    • Εικασία του Πουανκαρέ
  • Usage on en.wikiversity.org
    • Physics equations/22-Magnetism
  • Usage on es.wikipedia.org
    • Toro (geometría)
  • Usage on fi.wikipedia.org
    • Torus
  • Usage on ga.wikipedia.org
    • Tóras
  • Usage on he.wikipedia.org
    • השערת פואנקרה
    • פורטל:מתמטיקה/מאמר נבחר/אוסף
    • פורטל:מתמטיקה/מאמר נבחר/24
  • Usage on hyw.wikipedia.org
    • Թոր
  • Usage on it.wikipedia.org
    • Coomologia
  • Usage on it.wikibooks.org
    • Fisica classica/Dinamica del corpo rigido
  • Usage on it.wikiversity.org
    • Dinamica del corpo rigido (superiori)
  • Usage on ja.wikipedia.org
    • ポアンカレ予想
  • Usage on ml.wikipedia.org
    • ടോറസ്
    • പോയിൻകാരെ കൺജെക്ചർ
  • Usage on pl.wikibooks.org
    • Teoria grup przemiennych
  • Usage on pt.wikipedia.org
    • Usuária:Francieli Triches/Testes/Coomologia
  • Usage on sh.wikipedia.org
    • Torus
  • Usage on sq.wikipedia.org
    • Torusi
  • Usage on sr.wikipedia.org
    • Poenkareova hipoteza
  • Usage on th.wikipedia.org
    • ข้อความคาดการณ์ของปวงกาเร
  • Usage on tr.wikipedia.org
    • Eylemsizlik momenti
    • Poincaré hipotezi
    • Tesselasyon
  • Usage on vi.wikipedia.org
    • Hình xuyến
  • Usage on zh.wikipedia.org
    • 轉動慣量列表
    • 餘調

Metadata

Retrieved from "https://en.wikipedia.org/wiki/File:Torus_cycles.svg"