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, we need to switch context with Context('Complex')
. The problem Basic Operations of Complex numbers showed different ways of creating complex numbers.
This shows the functions Re
(real part), Im
(imaginary part), abs
(absolute value or modulus – distance from the origin), arg
(the angle the point is from 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
All of the answers here are placed in the {}
instead of making another variable.
BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT();
Solution
A solution should be provided here.