Essays/Complex Operations

From J Wiki
Jump to navigation Jump to search

By design, J has a very rich repertoire of operations with complex numbers. Here we will illustrate them grouped into categories.


Projection

Complex numbers derive from solutions of algebraic equations containing %:_1, denoted as 0j1 in J.

Complex number c corresponds to a point in a 2-dimensional plane. It can be represented with a pair of real coordinates (a, b) for the orthogonal real and imaginary axes forming a basis (1, 0j1), i.e. c = a + b*0j1.

The same point in polar coordinates is a pair (r, t) for radius and angle. The following relations hold

c = (r*cos t) + 0j1*r*sin t
a = r*cos t b = r*sin t
r = a +&.*: b t = arctan b%a

Real/Imaginary

+.y is a pair of real numbers (a,b) such that y = a j. b ↔ a + j. b.

Also y = (9 o.y) j. (11 o.y)

Magnitude

|a j.b ↔ a +&.*: b is a distance between the point and the origin. Also |z ↔ %:(* +)z ↔ (* +@*)z is a point turned back by its angle, thus assuming the positive direction of the real axis.

Also 10 o.y

Direction

*y ↔ y % |y ↔ (% |) y is a point on the unit circle (MathWorld:UnitVector) with the same angle t as y. Thus *y ↔ r.t ↔ ^j.t.

   *_2 0j2 1j1
_1 0j1 0.707107j0.707107

Angle

r.t is the direction vector with angle t or r.t ↔ ^j.t.

Also _12 o.t

r.^:_1*y is angle (argument) of y, which is also 0j_1*^.*. Also 12 o. y

   r.b._1
%&0j1@^.

Length and Angle

*.y is a pair (r,t) such that y = r*^j.t ↔ r r. t

Also y = (10 o.y) r. (12 o.y)

Polar

r r.t is a complex number z with magnitude r=|z and angle t=r.^:_1*z. Also, r r.t ↔ r * r.t ↔ r*^j.t. (See Phasor form.)

Phasor Form

z = (|z)* *z ↔ (| * *) z , product of its magnitude and direction.

Since direction is a point on the unit circle, there is angle t such that its real part is cos t and imaginary is sin t. Together, *z ↔ (cos t) + j.sin t, that is *z ↔ ^j.t (WikiPedia:Euler_formula). Thus, angle t = 0j_1*^.*z (See inverse of j. and r.).

   ^@j. b._1
0j_1&*@^.

Special case of MathWorld:EulerFormula is expressed as 0 = 1 + ^j.1p1 ↔ 1 + r.1p1 . (See Root of _1).


Reflection

The following reflections of z = a j.b can occur

    1*z     z   a j. b identity
  +_1*z   +-z (-a)j. b in the imaginary axis supplementary to _1
  + 1*z    +z   a j.-b in the real axis
   _1*z    -z (-a)j.-b in the origin
+0j_1*z  j.+z   b j. a in the line y=x complementary to 0j1
 0j_1*z -j. z   b j.-a
 0j1 *z  j. z (-b)j. a
+0j1 *z +j. z (-b)j.-a in the line y=-x complementary to 0j_1

Last column shows how result direction combines with the original (MathWorld:SupplementaryAngles, MathWorld:ComplementaryAngles), e.g.

   (*&* +@-) 2j1 1j2 _1j2 _2j1 _2j_1 _1j_2 1j_2 2j_1
_1 _1 _1 _1 _1 _1 _1 _1

Conjugate

+y   a j.-b a point reflected in the real axis

Direction of the conjugate is unit complementary: 1 = (*&* +) y. (See Product.)

(-:@+ +) z,   (-:@- +) z,   (%:@* +) z

Also _10 o. y.

Negation

-y  -a j.-b a point reflected in the origin

-y ↔ _1*y, i.e. rotated by half circle, as angle of _1 is 1p1.

Reciprocal

%y ↔ (+*y) % |y ↔ (+@* % |) y is a point with reciprocal magnitude and conjugate direction.

For points on the unit circle, it is just the conjugate. In particular, 0j_1 ↔ -0j1 ↔ %0j1 .

Inversion

%+y ↔ (*y) % |y ↔ (* % |) y is inversion in the unit circle, that is point with the same direction and reciprocal magnitude.


Rotation and Dilation

Imaginary

Monadic j.y defined as 0j1*y rotates the point 90 degrees counterclockwise (1r2p1 radians) around the origin. Also 11 o. y

   j. 1 0j1 _1 0j_1
0j1 _1 0j_1 1

Compare this with -y defined as _1*y which rotates 180 degrees (1p1).

   -1 0j1 _1 0j_1
_1 0j_1 1 0j1

Note: both these operations rotate by the angle their operative points (0j1 and _1) make with the positive direction of the real axis. Magnitude of the operative points is 1, thus they lie on the unit circle.

In general, arbitrary rotation around the origin can be represented as a product with a point on the unit circle whose angle determines the angle of rotation.

Inverse of j. means rotate 90 degrees the other way or 0j_1.

   j.b._1
0j_1&*

Root of _1

In particular, rotation by fractional part of pi 1p1 % n can be obtained by multiplication by the (first) n-th degree root of _1, n %: _1.

Repetitive rotation gives division of 1p1 by equal fractions 1p1 % n.

Rot.png
plot 0,.(3 %: _1) * ^:(i.6) 1

Thus j.c is c*%:_1 (or c*0j1), as 1r2 of 1p1 corresponds to square (second) root of _1.

Roots of Unity

Similary rotation by fractions of 2p1 is obtained by n-th degree root of 1. 1 is full circle from itself, 1 = ^j.2p1 ↔ r.2p1.

Since 2p1 is a full circle all the repetitive fractions (r.2p1%n)^i.n are the solutions to .

   ((r.2p1%5)^i.5)^5
1 1 1 1j_2.02128e_15 1j_1.1331e_15

Product

z = x * y is a point with magnitude as product of magnitudes and angle as sum of angles: if x=xr r.xt and y=yr r.yt then z = (xr*yr) r. xt+yt.

Multiplication by a point on the unit circle is rotation by the angle of that point; multiplication by its conjugate rotates back (in the opposite direction).

Tables of forward and reverse quadrant rotations

   (*/~ ; %/~) 1 0j1 _1 0j_1
+-------------------+-------------------+
|   1  0j1   _1 0j_1|   1 0j_1   _1  0j1|
| 0j1   _1 0j_1    1| 0j1    1 0j_1   _1|
|  _1 0j_1    1  0j1|  _1  0j1    1 0j_1|
|0j_1    1  0j1   _1|0j_1   _1  0j1    1|
+-------------------+-------------------+
   ((* +)"0/~ -: %/~)1 0j1 _1 0j_1
1

Integer Power

Positive power n of z=r r. t is (r^n) r. n*t, that is power of magnitude and replication of the angle.

Negative power is z^-n ↔ %z^n.

Root

Conversely from Power, integer root n of z=r r. t is (n%:r) r. t%n, that is root of magnitude and fraction of the angle.

Consecutive fractional powers (i.n+1)%n divide the angle of of the point into equal angles of n%:z. To preserve the radius of the sectors, the sequence is multiplied by the unit complements of the corresponding powers of the magnitude.

Root.png
plot 0,.(3j4^(i.6+1)%6) * (|3j4)^-.(i.6+1)%6

Other Operations

Translation

(a j.b) + (c j.d) = (a+b)j.(c+d) offset corresponding coordinates along the real and imaginary axes.

Residue

The dyad | applies to complex numbers. Moreover, the "fit" conjunction may be applied to control the tolerance used. Dictionary.

Relations Undefined

The dyads < <: >: > are undefined for complex numbers, since they form an unordered field.

Floor and Ceiling

As identified in the J Dictionary, it is not for faint-hearted. But spectrum instantly reveals how it's been inspired by aerial views of countryside around Vienna.

Entier.png
viewmat&> (] ; <. ; >.) |.j.~/~0.2*i:10

See Also


Contributed by Oleg Kobchenko [Category:OlegKobchenko]]