summaryrefslogtreecommitdiff
path: root/DiscoBot/imaginary.cs
blob: 9855dc2088d8502ad072c60848cbbbcf2d1ecc7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DiscoBot
{
    public class imaginary
    {
        public double re;
        public double im;

        public imaginary(imaginary i)
        {
            this.re = i.re;
            this.im = i.im;
        }
        public imaginary(double r, double i)
        {
            this.re = r;
            this.im = i;
        }


        public void step(imaginary c)
        {
            double temp = re;
            re = (re * re) - (im * im) + c.re;
            im = (2.0 * temp * im + c.im);
        }
    }
}