Piccole modifiche.

Leonardo Robol [2010-02-26 10:02]
Piccole modifiche.
Filename
NewtonFractal.py
diff --git a/NewtonFractal.py b/NewtonFractal.py
index afb248d..56f41e5 100755
--- a/NewtonFractal.py
+++ b/NewtonFractal.py
@@ -72,16 +72,17 @@ def Newton(size = 200, filename="newton.pnm"):
     # Scriviamo la matrice su file
     for x in x_range:
         for y in y_range:
+            # Otteniamo un valore "rappresentativo" della velocità di convergenza
             value = GetNewtonConvergenceSpeed(complex(-2 + x * delta,
                                                       -2 + y * delta))
-            f.write( str(3 * value) + " " +
-                     str(5 * value) + " " +
-                     str(9 * value) + "\n")
+            # Scriviamo i valori RGB moltiplicandoli per dei coefficienti in modo
+            # da avere più blu.
+            f.write( " ".join( [str(3 * value), str(5 * value), str(9*value)] )+ "\n")
     f.close ()


 if __name__ == "__main__":

-    # Creiamo un'immagine 1024px x 1024px.
-    Newton (1024, "newton.pnm")
+    # Creiamo un'immagine 800px x 800px.
+    Newton (800, "newton.pnm")
ViewGit