I managed to follow this up until the word "Can"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
What on earth are you studying that needs you to work with numbers in polar form?When working with real and imaginary numbers in polar form
Electronics. We use them a lot to work out impedances of electronic components.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
thanks very much!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