equal
deleted
inserted
replaced
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) |