It is necessary to create a complex number: real (a1) and imaginary (b1) (the class is a parent and its fields). Calculate the module of a complex number (method 1) and find the complex number that is the inverse of the given one (method 2)
I need help, I canβt figure it out anymore. Help to add 2 methods
public class Complex { private final double a1; // the real part private final double b1; // the imaginary part // create a new object with the given real and imaginary parts public Complex(double real, double imag) { a1 = real; b1 = imag; } public Complex modul(Complex b, Complex a) { ΠΌΠ΅ΡΠΎΠ΄ Π½Π°Ρ
ΠΎΠΆΠ΄Π΅Π½ΠΈΡ ΠΌΠΎΠ΄ΡΠ»Ρ ΠΊΠΎΠΌΠΏΠ»Π΅ΠΊΡΠ½ΠΎΠ³ΠΎ ΡΠΈΡΠ»Π° double real = ? // double imag = ? return new Complex(real, imag); } public Complex returnchisl(Complex b, Complex a) { ΠΌΠ΅ΡΠΎΠ΄ Π½Π°Ρ
ΠΎΠΆΠ΄Π΅Π½ΠΈΡ ΡΠΈΡΠ»Π°, ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠ΅ Π·Π°Π΄Π°Π½Π½ΠΎΠΌΡ } }