Visual – Coordinate polari

Vedi: Wikipedia > Sistema di coordinate polari.


La prima immagine rappresenta la funzione \rho=1 con 0 \le \theta \le 2 \pi.
Le successive sono variazioni della prima.

from visual       import *
from visual.graph import * 

def funzione(x): return 1 

START=0     # primo valore
STOP =2*pi  # ultimo valore
FMAX =1     # valore massimo 
N=1000      # punti calcolati
DURATA=5    # durata, in secondi

gdisplay(title="f(x)=x", width=500,height=500, xmin=-FMAX,xmax=FMAX, ymin=-FMAX,ymax=FMAX) 
g=gdots(color=color.red)

STEP=STOP/N
for angolo in arange(START,STOP,STEP):    
    rate(N/DURATA)    
    r=funzione(angolo)    
    x=r*cos(angolo)    
    y=r*sin(angolo)    
    g.plot(pos=(x,y))

\rho=\theta
  • FMAX =2*pi

\rho=\theta
  • START=0
  • STOP=10*pi
  • FMAX=10*pi
  • N=2000

\rho=\theta
  • START=0
  • STOP=5*pi
  • FMAX=5*pi
  • N=1000

Disegnata 2 volte…


\rho=\log (1+\theta)
  • START=0
  • STOP=12*pi
  • FMAX=4
  • N=2000

Funzione coseno


\rho=\cos \theta
  • START=0
  • STOP=pi
  • FMAX=1
  • N=1000

\rho=|\cos \theta |
  • STOP=2*pi

\rho=(\cos \theta)^2

1+coseno…


\rho=1+\cos \theta
  • START=0
  • STOP=2*pi
  • FMAX=2

\rho=1+2*cos(\theta)
  • START=0
  • STOP=2*pi
  • FMAX=3

\rho=1+|\cos \theta|

\rho=1+(\cos \theta)^2

Variazioni della pulsazione


\rho=\cos 2\theta
  • Per n pari, 2n petali

\rho=\cos 3\theta
  • Per n dispari, n petali

\rho=\cos \frac{1}{2}\theta
  • STOP=4*pi

\rho=\cos \frac{1}{3}\theta
  • STOP=3*pi

\rho=\cos \frac{2}{3}\theta
  • STOP=6*pi
  • N=2000

Reciproco del coseno


\rho=\frac{1}{\cos 2x}
  • START=0
  • STOP=2*pi
  • FMAX=2
  • N=2000

\rho=\frac{1}{\cos\frac{1}{2}x}
  • STOP=4*pi

\rho=\frac{1}{\cos\frac{1}{3}x}
  • STOP=3*pi
  • FMAX=3

\rho=\frac{1}{\cos\frac{2}{3}x}
  • STOP=6*pi
  • FMAX=3

Tangente…


\rho=\tan \theta
  • START=0
  • STOP=2*pi
  • FMAX=1
  • N=1000

\rho=\tan \frac{1}{2}\theta
  • FMAX=2

\rho=|\tan \theta|^{\frac{1}{|\tan \theta|}}
  • STOP=pi
  • FMAX=1.5

\rho=1+|\tan \theta|^{\frac{1}{|\tan \theta|}}
  • STOP=2*pi

Ancora…


\rho=\cos(x)+\cos(3x)
  • START=0
  • STOP=2*pi
  • FMAX=2


Lascia un commento