Skip to content

RandomComplex ​

A uniformly random complex number in a rectangle of the complex plane.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageRandomComplex!
RandomComplex()uniform over the unit square (real and imaginary parts each in [0, 1])
RandomComplex(zmax)uniform over the rectangle with corners 0 and zmax
RandomComplex({zmin, zmax})uniform over the rectangle with corners zmin and zmax
Typed signatures
TypePackageApplies
(any?) random -> anycombinatoricsalways

Domain: Collections

Details
  • Draws from the SAME seeded stream as RandomInteger (call SeedRandom(seed) first for a reproducible sequence) — our own generator, not Wolfram's, so only the shape and range of the answer are guaranteed to match.

Examples

Basic #

Reseeded explicitly so the example stays reproducible regardless of whatever else has already drawn from this engine's shared stream

live ↗
InLast([SeedRandom(42),RandomComplex()])\mathrm{Last}(\bigl\lbrack\mathrm{SeedRandom}(42), \mathrm{RandomComplex}()\bigr\rbrack)Out0.601 103 751 920 163 6+0.448 290 558 997 541 67i0.601\,103\,751\,920\,163\,6+0.448\,290\,558\,997\,541\,67i
Scope #
live ↗
InLast([SeedRandom(7),RandomComplex(2+3i)])\mathrm{Last}(\bigl\lbrack\mathrm{SeedRandom}(7), \mathrm{RandomComplex}(2+3i)\bigr\rbrack)Out0.023 409 506 306 052 208+0.185 874 772 723 764 18i0.023\,409\,506\,306\,052\,208+0.185\,874\,772\,723\,764\,18i
live ↗
InLast([SeedRandom(9),RandomComplex([−1−i,1+i])])\mathrm{Last}(\bigl\lbrack\mathrm{SeedRandom}(9), \mathrm{RandomComplex}(\bigl\lbrack-1-i, 1+i\bigr\rbrack)\bigr\rbrack)Out−0.602 542 163 804 173 5+0.702 421 592 548 489 6i-0.602\,542\,163\,804\,173\,5+0.702\,421\,592\,548\,489\,6i
About
Examples3
Checked againstWolfram Language 3 differ
CrosswalkWolfram Language

See also: RandomInteger, SeedRandom