- https://pl.wikibooks.org/wiki/Mechanika_teoretyczna
- https://pl.wikibooks.org/wiki/Metody_numeryczne_fizyki
- https://pl.wikibooks.org/wiki/Metody_matematyczne_fizyki
- https://pl.wikibooks.org/wiki/Analiza_matematyczna
Program koduj macierze przekształceń właściwą dla dwóch wymiarów:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from visual import *
import ImageGrab
display(x=0, y=0, width=400, height=400, userzoom=False,
center=(0, 0, 1), foreground=(0, 0, 0), background=(1, 1, 1))
ar = arrow(pos=(0, 0, 0), axis=(10, 0, 0), shaftwidth=0.3)
total_angle = 0
angle = 0.1 / (2 * math.pi)
frame = 0
while total_angle <= 2 * math.pi:
rate(100)
nx = ar.axis.x * math.cos(angle) - ar.axis.y * math.sin(angle)
ny = ar.axis.x * math.sin(angle) + ar.axis.y * math.cos(angle)
nz = 0
ar.axis = (nx, ny, nz)
file_name = 'img-' + '{fr:03d}'.format(fr=frame) + '.png'
frame += 1
im = ImageGrab.grab((0, 0, 400, 400))
im.save(file_name)
total_angle += angle
print total_angle
exit()

Brak komentarzy:
Prześlij komentarz