1 USING: help.markup help.syntax math math.private math.functions
5 ARTICLE: "complex-numbers" "Complex numbers"
6 { $subsection complex }
7 "Complex numbers arise as solutions to quadratic equations whose graph does not intersect the " { $emphasis "x" } " axis. Their literal syntax is covered in " { $link "syntax-complex-numbers" } "."
9 "Unlike math, where all real numbers are also complex numbers, Factor only considers a number to be a complex number if its imaginary part is non-zero. However, complex number operations are fully supported for real numbers; they are treated as having an imaginary part of zero."
11 "Complex numbers can be taken apart:"
12 { $subsection real-part }
13 { $subsection imaginary-part }
15 "Complex numbers can be constructed from real numbers:"
17 { $see-also "syntax-complex-numbers" } ;
19 { $class-description "The class of complex numbers with non-zero imaginary part." } ;
21 ABOUT: "complex-numbers"
24 { $values { "x" "a complex number" } { "y" "a complex number" } { "xr" "real part of " { $snippet "x" } } { "xi" "imaginary part of " { $snippet "x" } } { "yr" "real part of " { $snippet "y" } } { "yi" "imaginary part of " { $snippet "y" } } }
25 { $description "Extracts real and imaginary components of two numbers at once." } ;
28 { $values { "x" "a complex number" } { "y" "a complex number" } { "r" "a real number" } { "i" "a real number" } { "m" "a real number" } }
30 "Complex division kernel. If we use the notation from " { $link 2>rect } ", this word computes:"
38 HELP: <complex> ( x y -- z )
39 { $values { "x" "a real number" } { "y" "a real number" } { "z" "a complex number" } }
40 { $description "Low-level complex number constructor. User code should call " { $link rect> } " instead." } ;