progs/mandelbrot.scala
changeset 265 59779ce322a6
parent 195 fc3ac7b70a06
child 266 ca48ac1d3c3e
equal deleted inserted replaced
264:ecd989eee8bd 265:59779ce322a6
     8 import java.awt.image.BufferedImage
     8 import java.awt.image.BufferedImage
     9 import javax.swing.JFrame
     9 import javax.swing.JFrame
    10 import javax.swing.JPanel
    10 import javax.swing.JPanel
    11 import javax.swing.WindowConstants
    11 import javax.swing.WindowConstants
    12 import scala.language.implicitConversions    
    12 import scala.language.implicitConversions    
       
    13 
    13 
    14 
    14 // complex numbers
    15 // complex numbers
    15 case class Complex(val re: Double, val im: Double) { 
    16 case class Complex(val re: Double, val im: Double) { 
    16   // represents the complex number re + im * i
    17   // represents the complex number re + im * i
    17   def +(that: Complex) = Complex(this.re + that.re, this.im + that.im)
    18   def +(that: Complex) = Complex(this.re + that.re, this.im + that.im)