Gaussian Integer

Author

Eric W. Weisstein
March 28, 2005

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/GaussianInteger.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/GaussianInteger.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Additional Authors

Roots code by
Michael Trott
The Mathematica GuideBook for Graphics
New York: Springer-Verlag, 2004

Multiplication

ComplexExpand[Through[{Re,Im}[(a+b I)(c+d I)]]]

Roots

This code by Michael Trott

roots[g_, r_, n_] := Point /@ 
      Table[{Re[#], Im[#]}& @ Exp[r (Log[g] + 2 Pi I k)], {k, -n, n}];

Module[{d=20,n=3(* depending on # *),data},Show[GraphicsArray[Graphics[{PointSize[0.002],data=Table[If[i==j==0,{},roots[N[i+I j],#,n]],{i,-d,d},{j,-d,d}]},AspectRatio->Automatic,(* origin in center *)
PlotLabel->TraditionalForm[r==#],
PlotRange->Max[Abs[Transpose[DeleteCases[Level[N[DeleteCases[data,{},{2}]],{-2}],{_Symbol,_Symbol}]]]] {{-1,1},{-1,1}}]&/@{8/7,3/4,8/11}],ImageSize->500]
]