Fitxer:Tautochrone_curve.gif
From Wikipedia, the free encyclopedia
Tautochrone_curve.gif (300 × 200 píxels, mida del fitxer: 102 Ko, tipus MIME: image/gif, en bucle, 80 fotogrames, 3,2 s)
Aquest fitxer i la informació mostrada a continuació provenen del dipòsit multimèdia lliure Wikimedia Commons. Vegeu la pàgina original a Commons |
Resum
DescripcióTautochrone curve.gif |
A tautochrone curve is the curve for which the time taken by an object sliding without friction in uniform gravity to its lowest point is independent of its starting point. Here, four points at different positions reach the bottom at the same time. In the graphic, s represents arc length, t represents time, and the blue arrows represent acceleration along the trajectory. As the points reach the horizontal, the velocity becomes constant, the arc length being linear to time. |
Data | 9 de maig de 2007; new version agost de 2009 |
Font | Treball propi |
Autor |
Claudio Rocchini |
GIF genesis InfoField | Aquesta GIF imatge rasteritzada ha estat creada amb Matplotlib |
Codi font InfoField | Python code#!/usr/bin/python
# -*- coding: utf8 -*-
'''
animation of balls on a tautochrone curve
'''
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib import animation
from math import *
# settings
fname = 'Tautochrone curve'
width, height = 300, 200
nframes = 80
fps=25
balls = [
{'a':1.0, 'color':'#0000c0'},
{'a':0.8, 'color':'#c00000'},
{'a':0.6, 'color':'#00c000'},
{'a':0.4, 'color':'#c0c000'}]
def curve(phi):
x = phi + sin(phi)
y = 1.0 - cos(phi)
return np.array([x, y])
def animate(nframe, empty=False):
t = nframe / float(nframes - 1.)
# prepare a clean and image-filling canvas for each frame
fig = plt.gcf()
fig.clf()
ax_canvas = plt.gca()
ax_canvas.set_position((0, 0, 1, 1))
ax_canvas.set_xlim(0, width)
ax_canvas.set_ylim(0, height)
ax_canvas.axis('off')
# draw the ramp
x0, y0 = 293, 8
h = 182
npoints = 200
points = []
for i in range(npoints):
phi = i / (npoints - 1.0) * pi - pi
x, y = h/2. * curve(phi) + np.array([x0, y0])
points.append([x, y])
rampline = patches.Polygon(points, closed=False, facecolor='none',
edgecolor='black', linewidth=1.5, capstyle='butt')
points += [[x0-h*pi/2, y0], [x0-h*pi/2, y0+h]]
ramp = patches.Polygon(points, closed=True, facecolor='#c0c0c0', edgecolor='none')
# plot axes
plotw = 0.5
ax_plot = fig.add_axes((0.47, 0.46, plotw, plotw*2/pi*width/height))
ax_plot.set_xlim(0, 1)
ax_plot.set_ylim(0, 1)
for b in balls:
time_array = np.linspace(0, 1, 201)
phi_pendulum_array = (1 - b['a'] * np.cos(time_array*pi/2))
ax_plot.plot(time_array, phi_pendulum_array, '-', color=b['color'], lw=.8)
ax_plot.set_xticks([])
ax_plot.set_yticks([])
ax_plot.set_xlabel('t')
ax_plot.set_ylabel('s')
ax_canvas.add_patch(ramp)
ax_canvas.add_patch(rampline)
for b in balls:
# draw the balls
phi_pendulum = b['a'] * -cos(t * pi/2)
phi_wheel = 2 * asin(phi_pendulum)
phi_wheel = -abs(phi_wheel)
x, y = h/2. * curve(phi_wheel) + np.array([x0, y0])
ax_canvas.add_patch(patches.Circle((x, y), radius=6., zorder=3,
facecolor=b['color'], edgecolor='black'))
ax_plot.plot([t], [1 + phi_pendulum], '.', ms=6., mec='none', mfc='black')
v = h/2. * np.array([1 + cos(phi_wheel), sin(phi_wheel)])
vnorm = v / hypot(v[0], v[1])
# in the harmonic motion, acceleration is proportional to -position
acc_along_line = 38. * -phi_pendulum * vnorm
ax_canvas.arrow(x, y, acc_along_line[0], acc_along_line[1],
head_width=6, head_length=6, fc='#1b00ff', ec='#1b00ff')
fig = plt.figure(figsize=(width/100., height/100.))
print 'saving', fname + '.gif'
#anim = animation.FuncAnimation(fig, animate, frames=nframes)
#anim.save(fname + '.gif', writer='imagemagick', fps=fps)
frames = []
for nframe in range(nframes):
frame = fname + '_{:02}.png'.format(nframe)
animation.FuncAnimation(fig, lambda n: animate(nframe), frames=1).save(
frame, writer='imagemagick')
frames.append(frame)
# assemble animation using imagemagick, this avoids dithering and huge filesize
os.system('convert -delay {} +dither +remap -layers Optimize {} "{}"'.format(
100//fps, ' '.join(['"' + f + '"' for f in frames]), fname + '.gif'))
for frame in frames:
if os.path.exists(frame):
os.remove(frame)
|
Llicència
Jo, el titular dels drets d'autor d'aquest treball, el public sota les següents llicències:
S'autoritza la còpia, la distribució i la modificació d'aquest document sota els termes de la llicència de documentació lliure GNU versió 1.2 o qualsevol altra versió posterior que publiqui la Free Software Foundation; sense seccions invariants, ni textos de portada, ni textos de contraportada. S'inclou una còpia d'aquesta llicència en la secció titulada GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Aquest fitxer està subjecte a la llicència de Creative Commons Reconeixement i Compartir Igual 3.0 No adaptada. | ||
| ||
Aquest avís de llicència s'ha afegit a aquest fitxer d'acord amb l'actualització de la llicència GFDL.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
Aquest fitxer està disponible sota la llicència Creative Commons Reconeixement 2.5 Genèrica.
- Sou lliure de:
- compartir – copiar, distribuir i comunicar públicament l'obra
- adaptar – fer-ne obres derivades
- Amb les condicions següents:
- reconeixement – Heu de donar la informació adequada sobre l'autor, proporcionar un enllaç a la llicència i indicar si s'han realitzat canvis. Podeu fer-ho amb qualsevol mitjà raonable, però de cap manera no suggereixi que l'autor us dóna suport o aprova l'ús que en feu.
Podeu seleccionar la llicència que vulgueu.
Elements representats en aquest fitxer
representa l'entitat
Algun valor sense element de Wikidata
9 maig 2007
image/gif
Historial del fitxer
Cliqueu una data/hora per veure el fitxer tal com era aleshores.
Data/hora | Miniatura | Dimensions | Usuari/a | Comentari | |
---|---|---|---|---|---|
actual | 15:15, 1 ago 2009 | 300 × 200 (102 Ko) | Geek3 | new physically correct version | |
08:56, 9 maig 2007 | 300 × 200 (602 Ko) | Rocchini | {{Information |Description=Tautochrone curve animation (4 points runs over a cycloid) |Source=Own work |Date=2007-05-09 |Author=Claudio Rocchini |Permission=CC-BY 2.5 }} |
Ús del fitxer
La pàgina següent utilitza aquest fitxer:
Ús global del fitxer
Utilització d'aquest fitxer en altres wikis:
- Utilització a ar.wikipedia.org
- Utilització a bn.wikipedia.org
- Utilització a da.wikipedia.org
- Utilització a de.wikipedia.org
- Utilització a de.wikiversity.org
- Utilització a en.wikipedia.org
- Utilització a es.wikipedia.org
- Utilització a fa.wikipedia.org
- Utilització a fr.wikipedia.org
- Utilització a fr.wikibooks.org
- Utilització a fr.wiktionary.org
- Utilització a he.wikipedia.org
- Utilització a hr.wikipedia.org
- Utilització a id.wikipedia.org
- Utilització a it.wikipedia.org
- Utilització a ja.wikipedia.org
- Utilització a kk.wikipedia.org
- Utilització a ko.wikipedia.org
- Utilització a lt.wikipedia.org
- Utilització a lv.wikipedia.org
- Utilització a nl.wikipedia.org
- Utilització a nn.wikipedia.org
- Utilització a no.wikipedia.org
- Utilització a pl.wikipedia.org
- Utilització a pt.wikipedia.org
- Utilització a ro.wikipedia.org
- Utilització a ru.wikipedia.org
- Utilització a sl.wikipedia.org
- Utilització a tr.wikipedia.org
- Utilització a www.wikidata.org
- Utilització a zh.wikipedia.org