public class TestComplexNumber {
public static void main(String[] args) {
//I decide two numbers
ComplexNumber data1=new ComplexNumber(1,1);
ComplexNumber data2=new ComplexNumber(1,1);
System.out.println("Number1+Number2="+data1.add(data2)); //data1+data2 operation
System.out.println("Number1-Number2="+data1.subtract(data2)); //data1-data2 operation
System.out.println("Number1*Number2="+data1.multiply(data2)); //data1*data2 operation
System.out.println("Number1/Number2="+data1.divide(data2)); //data1/data2 operation
System.out.println("Conjugate Number1 ="+data1.conjugate(data1)+" Conjugate Number1 ="+data2.conjugate(data2)); //if we take like this there is no problem and the followings
System.out.println("Reciprocal Number1 ="+data1.reciprocal()+" Reciprocal Number2 ="+data2.reciprocal());
System.out.println("Number1's angle="+data1.getAngle(data1)+" Number2's angle="+data2.getAngle(data2));
System.out.println("Number1's magnitude="+data1.getMagnitude(data1)+" Number2's magnitude="+data2.getMagnitude(data2));
if(data1.equals(data2)){
System.out.println("The two numbers are equal");
}else{
System.out.println("The two numbers are not equal");
}
}
}
Hiç yorum yok:
Yorum Gönder