Other complex operations.
Download file: OtherOperations.pg
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');
Preamble
These standard macros need to be loaded.Context('Complex');
$z0 = Complex(non_zero_random(-5, 4), non_zero_random(-5, 5));
$z1 = Complex(non_zero_random(-5, 4), non_zero_random(-5, 5));
$z2 = Complex(non_zero_random(-5, 4), non_zero_random(-5, 5));
Setup
To use complex numbers, switch to the Complex context
with Context('Complex').
See the problem Basic Operations of Complex numbers for different ways of creating complex numbers.
This shows the usage of the functions Re (real part),
Im (imaginary part), abs (absolute value or
modulus which gives the distance from the origin), arg (the
angle with the positive real axis), and conj (the complex
conjugate).
BEGIN_PGML
Let [`z_0 = [$z0]`], [`z_1 = [$z1]`], and [`z_2 = [$z2]`]. Find
[`\text{Re}(z_0) =`] [___]{Re($z0)}
[`\text{Im}(z_0) =`] [_____]{Im($z0)}
[`|z_1| =`] [___]{abs($z1)}
[`\text{arg}(z_1) =`] [___]{arg($z1)}
[`\text{conj}(z_2) =`] [___]{conj($z2)}
END_PGML
Statement
This is the problem statement in PGML.BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT();
Solution
A solution should be provided here.