Can anybody just verify if I am right in thinking the following little equation is correct?
When working with real and imaginary numbers in polar form I am right in thinking that you times or divide the real part and add or subtract the imaginary part, yes?
View attachment 42950
When working with real and imaginary numbers in polar form
What on earth are you studying that needs you to work with numbers in polar form?
Not something you come across very often (read: ever!).
Can anybody just verify if I am right in thinking the following little equation is correct?
package foo.bar;
import org.apache.commons.math3.complex.*;
import org.apache.commons.math3.util.FastMath;
public class Main {
public static void main(String[] args) {
Complex p1 = ComplexUtils.polar2Complex(100, FastMath.toRadians(20));
Complex p2 = p1.divide(ComplexUtils.polar2Complex(2, FastMath.toRadians(60)));
double theta = FastMath.atan(p2.getImaginary() / p2.getReal());
double mag = FastMath.sqrt(p2.getImaginary() * p2.getImaginary() + p2.getReal() * p2.getReal());
System.out.println(mag + "L" + FastMath.toDegrees(theta));
}
}
So, yeah, you're right - and yes, I'm in idle mode (not sayin' I'm bored), but this took only a couple of minutes anyway50.0L-40.00000000000000
Output:Code:package foo.bar; import org.apache.commons.math3.complex.*; import org.apache.commons.math3.util.FastMath; public class Main { public static void main(String[] args) { Complex p1 = ComplexUtils.polar2Complex(100, FastMath.toRadians(20)); Complex p2 = p1.divide(ComplexUtils.polar2Complex(2, FastMath.toRadians(60))); double theta = FastMath.atan(p2.getImaginary() / p2.getReal()); double mag = FastMath.sqrt(p2.getImaginary() * p2.getImaginary() + p2.getReal() * p2.getReal()); System.out.println(mag + "L" + FastMath.toDegrees(theta)); } }
So, yeah, you're right - and yes, I'm in idle mode (not sayin' I'm bored), but this took only a couple of minutes anyway
We use essential cookies to make this site work, and optional cookies to enhance your experience.