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

add explanation
Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Factor, 56 bytes

[ normal-random-float 2pi random 2dup cos * -rot sin * ]

Try it online!

Verifying correctness:

enter image description here

Explanation

 ! 1 0.1
normal-random-float ! 1.091729295255315
2pi ! 1.091729295255315 6.283185307179586
random ! 1.091729295255315 4.669140230445313
2dup ! 1.091729295255315 4.669140230445313 1.091729295255315 4.669140230445313
cos ! 1.091729295255315 4.669140230445313 1.091729295255315 -0.04323526873134136
* ! 1.091729295255315 4.669140230445313 -0.04720120946224146
-rot ! -0.04720120946224146 1.091729295255315 4.669140230445313
sin ! -0.04720120946224146 1.091729295255315 -0.9990649185802335
* ! -0.04720120946224146 -1.090708439475907

Factor, 56 bytes

[ normal-random-float 2pi random 2dup cos * -rot sin * ]

Try it online!

Verifying correctness:

enter image description here

Factor, 56 bytes

[ normal-random-float 2pi random 2dup cos * -rot sin * ]

Try it online!

Verifying correctness:

enter image description here

Explanation

 ! 1 0.1
normal-random-float ! 1.091729295255315
2pi ! 1.091729295255315 6.283185307179586
random ! 1.091729295255315 4.669140230445313
2dup ! 1.091729295255315 4.669140230445313 1.091729295255315 4.669140230445313
cos ! 1.091729295255315 4.669140230445313 1.091729295255315 -0.04323526873134136
* ! 1.091729295255315 4.669140230445313 -0.04720120946224146
-rot ! -0.04720120946224146 1.091729295255315 4.669140230445313
sin ! -0.04720120946224146 1.091729295255315 -0.9990649185802335
* ! -0.04720120946224146 -1.090708439475907
Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Factor, 56 bytes

[ normal-random-float 2pi random 2dup cos * -rot sin * ]

Try it online!

Verifying correctness:

enter image description here

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