Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Update MATL Online URL
Source Link
Suever
  • 11.2k
  • 1
  • 24
  • 52

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online MATL Online! (it takes 10‒15 seconds).

How it works

Uses method 2 described in the challenge.

Xr % Push random number with standard Gaussian distribution
* % Implicit input: r. Multiply
+ % Implicit input: s. Add
J % Push imaginary unit
r % Push random number with stantard uniform distribution
4 % Push 4
* % Multiply
^ % Power
* % Multiply. Implicit output

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

How it works

Uses method 2 described in the challenge.

Xr % Push random number with standard Gaussian distribution
* % Implicit input: r. Multiply
+ % Implicit input: s. Add
J % Push imaginary unit
r % Push random number with stantard uniform distribution
4 % Push 4
* % Multiply
^ % Power
* % Multiply. Implicit output

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

How it works

Uses method 2 described in the challenge.

Xr % Push random number with standard Gaussian distribution
* % Implicit input: r. Multiply
+ % Implicit input: s. Add
J % Push imaginary unit
r % Push random number with stantard uniform distribution
4 % Push 4
* % Multiply
^ % Power
* % Multiply. Implicit output
added 332 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

How it works

Uses method 2 described in the challenge.

Xr % Push random number with standard Gaussian distribution
* % Implicit input: r. Multiply
+ % Implicit input: s. Add
J % Push imaginary unit
r % Push random number with stantard uniform distribution
4 % Push 4
* % Multiply
^ % Power
* % Multiply. Implicit output

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

Uses method 2 described in the challenge.

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

How it works

Uses method 2 described in the challenge.

Xr % Push random number with standard Gaussian distribution
* % Implicit input: r. Multiply
+ % Implicit input: s. Add
J % Push imaginary unit
r % Push random number with stantard uniform distribution
4 % Push 4
* % Multiply
^ % Power
* % Multiply. Implicit output
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 10 bytes

Xr*+Jr4*^*

Inputs are r, then s. Output is a complex number.

Try it online! Or see the plot for 1000 points at MATL Online! (it takes 10‒15 seconds).

Uses method 2 described in the challenge.

AltStyle によって変換されたページ (->オリジナル) /