package com.github.nthportal.mathlib2.complex;

public class Complex {
    public final int real;
    public final int complex;

    public Complex(int real, int complex) {
        this.real = real;
        this.complex = complex;
    }

    public Complex add(Complex c) {
        return new Complex((real + c.real), (complex + c.complex));
    }

    public Complex subtract(Complex c) {
        return new Complex((real - c.real), (complex - c.complex));
    }

    public Complex multiply(Complex c) {
        return new Complex((real * c.real) - (complex * c.complex), (real * c.complex) + (complex * c.real));
    }

    public Complex conjugate() {
        return new Complex(real, -complex);
    }
}

@@ -41,16 +41,42 @@
 mplex;%0A%0A
+import java.util.Random;%0A%0A
 public c
@@ -90,16 +90,72 @@
 mplex %7B%0A
+    private static final Random random = new Random();%0A%0A
     publ
@@ -194,23 +194,25 @@
 nal int 
-complex
+imaginary
 ;%0A%0A    p
@@ -239,23 +239,25 @@
 al, int 
-complex
+imaginary
 ) %7B%0A    
@@ -295,25 +295,29 @@
 his.
-complex = complex
+imaginary = imaginary
 ;%0A  
@@ -406,27 +406,31 @@
 ), (
-complex + c.complex
+imaginary + c.imaginary
 ));%0A
@@ -526,27 +526,31 @@
 ), (
-complex - c.complex
+imaginary - c.imaginary
 ));%0A
@@ -647,59 +647,67 @@
  - (
-complex * c.complex), (real * c.complex) + (complex
+imaginary * c.imaginary), (real * c.imaginary) + (imaginary
  * c
@@ -789,23 +789,133 @@
 (real, -
-complex
+imaginary);%0A    %7D%0A%0A    public static Complex random() %7B%0A        return new Complex(random.nextInt(), random.nextInt()
 );%0A    %7D

Refactored Complex.complex to imaginary