1 / 9

Viscomp I

Viscomp I. c2-2011. Entrega TP1 ?. Fractales y mapeo del espacio. El conjunto de Mandelbrot : conjunto de valores complejos ( z ). Fractales y mapeo del espacio. Fractal de Mandelbrot Zr i = Zr i-1 2 + Z 0 Converge cuando el modulo es < 2 ComplexNumber z0 = new ComplexNumber(r,i);

kane-alston
Download Presentation

Viscomp I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Viscomp I c2-2011

  2. Entrega TP1 ?

  3. Fractales y mapeo del espacio • El conjunto de Mandelbrot : conjunto de valores complejos (z).

  4. Fractales y mapeo del espacio Fractal de Mandelbrot Zri = Zri-12 + Z0 • Converge cuando el modulo es < 2 ComplexNumber z0 = new ComplexNumber(r,i); ComplexNumber zn = new ComplexNumber(0,0); double modulo = zn.module(); while ((count<256) && ((modulo)<2)) { zn = ComplexNumber.add ( ComplexNumber.square(zn), z0); modulo = zn.module(); count++; } return (count); } /// Esta es la variable que vamos a usar para colorear

  5. Cómo dibujo en pantalla ? • Fractal determinado entre • Zr (reales ) : -1.5 < zr < 0.5 • Zi (imaginario : -1 < zi < 1 • Pantalla

  6. Fractales y mapeo del espacio • Dado px y py ,mapear a espacio complejo int w = Buffer.Width; int h = Buffer.Height; rMax = 0.5 ; rMin = -1.5; iMax = 1.0; iMin = -1.0; // Mapeo de la pantalla al fractal Double rRange = (rMax-rmin)/w; double iRange = (iMax-iMin)/h; int count = 0; double zr = px * rRange + rMin ; double zi = (h-py) * iRange + iMin; Ejemplos: Si px=512 dx = [0.5- (-1.5)] / 512 = 0.00390625 zr = 512 * 0.00390625 + (-1.5) = 0.5 Si px=0 dx = [0.5- (-1.5)] / 512 = 0.00390625 zr = 0 * 0.00390625 + (-1.5) = -1.5 Si px=256 dx = [0.5- (-1.5)] / 512 = 0.00390625 zr = 256 * 0.00390625 + (-1.5) = -0.5

  7. Operaciones de números complejos • class ComplexNumber {double r,i;… • Square: • r = r2– i2 • i = 2 * r * i • Add: • r = z1.r + z2.r • i = z1.i + z2.i • Mul: • r = z1.r * z2.r - z1.i * z2.i • i = z1.i * z2.r + z1.r * z2.i • Scale: • r = z1.r * scale • i = z1.i + scale • Module: • result = sqrt(r2 + i2)

  8. Manowar • c = z1(0) = z(0) • zn+1 = zn2 + z1n + c; • z1n+1 = zn;

  9. Spider • c = z(0) • zn+1 = zn2 + cn; • cn+1 = (cn/2) + zn+1 ;

More Related