*. y (Length/Angle)

Back to: Vocabulary

Converts x-y coordinates (given as a complex number) to r-theta coordinates ("theta" being in radians).

   *. 3j4   NB. x and y of 3-4-5 triangle
5 0.927295

Common uses

To convert (x,y) to polar coordinates

   polar=: 4 : '*. x j. y'
   30 polar 40
50 0.927295

See Also


x *. y (LCM (And))

Back to: Vocabulary

The logical operation And between two Boolean nouns x and y.

In the more general case where x or y are not Boolean, the result is the Least Common Multiple (LCM) of x and y.

   0 0 1 1 +. 0 1 0 1
0 0 0 1
   (0 1) *./ (0 1)      NB. Truth-table of: +.
0 0
0 1
   (0 1) +.table (0 1)  NB. Truth-table with borders
┌──┬───┐
│+.│0 1│
├──┼───┤
│0 │0 1│
│1 │1 1│
└──┴───┘
   *. table i.13        NB. table defaults x to: y
┌──┬────────────────────────────────────────┐
│*.│0  1  2  3  4  5  6  7  8  9  10  11  12│
├──┼────────────────────────────────────────┤
│ 0│0  0  0  0  0  0  0  0  0  0   0   0   0│
│ 1│0  1  2  3  4  5  6  7  8  9  10  11  12│
│ 2│0  2  2  6  4 10  6 14  8 18  10  22  12│
│ 3│0  3  6  3 12 15  6 21 24  9  30  33  12│
│ 4│0  4  4 12  4 20 12 28  8 36  20  44  12│
│ 5│0  5 10 15 20  5 30 35 40 45  10  55  60│
│ 6│0  6  6  6 12 30  6 42 24 18  30  66  12│
│ 7│0  7 14 21 28 35 42  7 56 63  70  77  84│
│ 8│0  8  8 24  8 40 24 56  8 72  40  88  24│
│ 9│0  9 18  9 36 45 18 63 72  9  90  99  36│
│10│0 10 10 30 20 10 30 70 40 90  10 110  60│
│11│0 11 22 33 44 55 66 77 88 99 110  11 132│
│12│0 12 12 12 12 60 12 84 24 36  60 132  12│
└──┴────────────────────────────────────────┘

This following is an animation for the And (boolean) that might be useful to those new to J

Embedded application/x-shockwave-flash

Common uses

To form a conditional statement

if. (0=#y) *. (0=#x) do.
  ...

See Also


CategoryVoc

Vocabulary/stardot (last edited 2011-12-21 03:23:28 by IanClark)