Imaginary: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Built-in|Imaginary|⌾}} is a monadic scalar function which multiplies the argument by the imaginary unit <source lang=apl inline>0J1</source>. This can be seen...") |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Built-in|Imaginary|⌾}} is a [[monadic]] [[scalar function]] which multiplies the [[argument]] by the imaginary unit < | {{Built-in|Imaginary|⌾}} is a [[monadic]] [[scalar function]] which multiplies the [[argument]] by the [[wikipedia:imaginary unit|imaginary unit]] <syntaxhighlight lang=apl inline>0J1</syntaxhighlight>, usually denoted <math>i</math> or <math>j</math> in traditional mathematics. This can be seen as a mapping from a real number to a pure imaginary number (a [[complex number]] with the real part of 0). It was added to [[J]] as <syntaxhighlight lang=j inline>j.</syntaxhighlight> together with initial support for complex numbers, and was adopted in [[Extended Dyalog APL]] using the [[glyph]] <syntaxhighlight lang=apl inline>⌾</syntaxhighlight> as a monadic counterpart of [[Complex (function)|Complex]]. In other APL implementations that support complex numbers, [[Circular]] with the left argument of <syntaxhighlight lang=apl inline>¯11</syntaxhighlight> has the same functionality as Imaginary. | ||
== Examples == | == Examples == | ||
[https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn//1Hf1EdtEx717FMwVji03kTB7P9/AA Try it online!]< | [https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn//1Hf1EdtEx717FMwVji03kTB7P9/AA Try it online!]<syntaxhighlight lang=apl> | ||
⌾ 3 ¯4 6 | ⌾ 3 ¯4 6 | ||
0J3 0J¯4 0J6 | 0J3 0J¯4 0J6 | ||
</ | </syntaxhighlight>{{Works in|[[Extended Dyalog APL]]}} | ||
Imaginary is equivalent to [[Complex (function)|Complex]] with the default left argument of 0. | |||
[https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn//1Hf1EdtEwwUHvXsUzBWOLTeRMHs/38A Try it online!]<syntaxhighlight lang=apl> | |||
0 ⌾ 3 ¯4 6 | |||
0J3 0J¯4 0J6 | |||
</syntaxhighlight>{{Works in|[[Extended Dyalog APL]]}} | |||
== See also == | |||
* [[Negate]] | |||
* [[Reciprocal]] | |||
== External links == | |||
=== Documentation === | === Documentation === | ||
* J [https://www.jsoftware.com/help/dictionary/djdot.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/jdot NuVoc] | * J [https://www.jsoftware.com/help/dictionary/djdot.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/jdot NuVoc] | ||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] |
Latest revision as of 22:05, 10 September 2022
⌾
|
Imaginary (⌾
) is a monadic scalar function which multiplies the argument by the imaginary unit 0J1
, usually denoted or in traditional mathematics. This can be seen as a mapping from a real number to a pure imaginary number (a complex number with the real part of 0). It was added to J as j.
together with initial support for complex numbers, and was adopted in Extended Dyalog APL using the glyph ⌾
as a monadic counterpart of Complex. In other APL implementations that support complex numbers, Circular with the left argument of ¯11
has the same functionality as Imaginary.
Examples
⌾ 3 ¯4 6 0J3 0J¯4 0J6
Works in: Extended Dyalog APL
Imaginary is equivalent to Complex with the default left argument of 0.
0 ⌾ 3 ¯4 6 0J3 0J¯4 0J6
Works in: Extended Dyalog APL
See also
External links
Documentation
- J Dictionary, NuVoc