Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Ici on fait les imports, les règlages de la fenêtre, etc... mais on ne s'y intéressera pas.
- #
- def VR(X,Y):
- l = pi/2 - atan(Y/X)
- r = sqrt(X**2+(Y-Ro)**2)
- return Vo*(Ro/r - 1)*(sin(l))
- Vo = 220000
- Ro = 262282594 * 10**12
- scale = W / Ro
- #
- min = -1
- max = Vo
- for x in range(1,W) :
- for y in range(1,H) :
- X,Y = x/scale, y/scale
- Vr = VR(X,Y)
- if Vr < min or min == -1:
- min = Vr
- #
- for x in range(1,W) :
- for y in range(1,H) :
- X,Y = x/scale, y/scale
- Vr = VR(X,Y)
- if Vr > max:
- coeff = 1
- else :
- coeff = (Vr-min)/(max-min)
- plot(x,y,rgb(coeff*255, 0, (1-coeff)*255))
Advertisement
Add Comment
Please, Sign In to add comment