File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,12 +230,12 @@ inline function cSub(a, b) => a - b;
230230
231231//Raises a real number to a complex power.
232232inline function cPowRC(real, complex) {
233- const p1 = cos(cI(complex) * ln(real) );
234- const p2 = sin(cI(complex) * ln(real) );
233+ const p1 = cos(cI(complex));
234+ const p2 = sin(cI(complex));
235235
236236 const mul = (real^cR(complex), 0);
237237
238- cMul(mul, (p1, p2))
238+ cMul(mul, ln(real) * (p1, p2))
239239}
240240
241241//Raises a complex number to a real power.
@@ -274,6 +274,11 @@ inline function cLn(a) {
274274 (p1, p2)
275275}
276276
277+ //Creates a complex number from polar form.
278+ inline function cPolar(abs, arg) {
279+ abs * (cos(arg), sin(arg))
280+ }
281+
277282//The complex sine function.
278283inline function cSin(a) {
279284 const p1 = sin(cR(a)) * cosh(cI(a));
You can’t perform that action at this time.
0 commit comments