Lattice Point and Complex Numbers
<p>I am having a hard time with the Multiplication method for the Complex numbers code. This line seems to be giving me the most trouble :</p>

<pre><code>public IntegerComplex multiply(IntegerComplex a){
    return new IntegerComplex((this.c*a.c - this.d*a.d)+(this.c*a.c + this.d*a.d));
}
</code></pre>

<p>I cannot figure it out for the life of me; right now I haven't ever coded for complex numbers before</p>

<pre><code>    public class LatticePoint {

        private int x;
        private int y;
        protected double distance;


        public LatticePoint()
        {
            x = 0;
            y = 0;
        }

        public LatticePoint(int x, int y){
            setX(x);
            setY(y);
        }

        public void setX(int x){
            this.x = x;
        }

        public int getX()
        {   
            return this.x;
        }

        public void setY(int y){
            this.y = y;     
        }

        public int getY()
        {
            return this.y;
        }

        public double distance(LatticePoint p){
            LatticePoint q = new LatticePoint(p.x - this.y, p.y - this.x);
            return q.distance();

        }

        public double distance()
        {
            return Math.sqrt((x*x)+(y*y));
        }

        public LatticePoint add(LatticePoint p){
            return new LatticePoint(this.x + p.x, this.y + p.y);
        }

        //returns this - p
        public LatticePoint sub(LatticePoint p){
            return new LatticePoint(this.x - p.x, this.y - p.y); 
        }


        public static void main(String[] args) {
            // TODO Auto-generated method stub

        }

            }


    public class IntegerComplex extends LatticePoint {

       private int c;
       private int d;


       public IntegerComplex()
        {
            super();
        }
        public IntegerComplex(int c, int d)
        {
            super.setX(c);
            super.setY(d);

        }

        public int getC(){
            return this.c;
        }
        public int getD(){
            return this.d;
        }

        public IntegerComplex add(IntegerComplex a){
    super.add(a);
            return a;
        }

        public double distance(IntegerComplex a){
            super.distance(a);
            return a.distance();
        }


        public IntegerComplex multiply(IntegerComplex a){
            return new IntegerComplex((this.c*a.c - this.d*a.d)+(this.c*a.c +this.d*a.d));
        }



        public static void main(String[] args) {
            // TODO Auto-generated method stub

        }

    }
</code></pre>
