Skip to main content
Commonmark migration
Source Link

#R, 60 56 53 49 bytes

R, 60 56 53 49 bytes

An extra 4 bytes thanks to @JayCe and changing it to a function.

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

function(n,y=acos(runif(n)))runif(n)*2*pi+c(y,-y)

Try it online!

#R, 60 56 53 49 bytes

An extra 4 bytes thanks to @JayCe and changing it to a function.

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

function(n,y=acos(runif(n)))runif(n)*2*pi+c(y,-y)

Try it online!

R, 60 56 53 49 bytes

An extra 4 bytes thanks to @JayCe and changing it to a function.

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

function(n,y=acos(runif(n)))runif(n)*2*pi+c(y,-y)

Try it online!

added 208 characters in body
Source Link
MickyT
  • 12.3k
  • 2
  • 27
  • 49

#R, 60 56 5353 49 bytes

An extra 4 bytes thanks to @JayCe and changing it to a function.

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

x=runiffunction(n<-scann,y=acos(runif(n))*2*pi;y=acos()runif(n));cat*2*pi+c(x+yy,x-y)

Try it online!

#R, 60 56 53

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

x=runif(n<-scan())*2*pi;y=acos(runif(n));cat(x+y,x-y)

#R, 60 56 53 49 bytes

An extra 4 bytes thanks to @JayCe and changing it to a function.

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

function(n,y=acos(runif(n)))runif(n)*2*pi+c(y,-y)

Try it online!

move comment for leaderboard
Source Link
Martin Ender
  • 198.5k
  • 67
  • 455
  • 1k
 

#R, 60 56 53

  

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

x=runif(n<-scan())*2*pi;y=acos(runif(n));cat(x+y,x-y)
 

#R, 60 56 53

 

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

x=runif(n<-scan())*2*pi;y=acos(runif(n));cat(x+y,x-y)

#R, 60 56 53

 

Using the same basic formula as the others. R uses the Mersenne-Twister method by default, but others can be set. Outputs a space separated list.

x=runif(n<-scan())*2*pi;y=acos(runif(n));cat(x+y,x-y)
added 72 characters in body
Source Link
MickyT
  • 12.3k
  • 2
  • 27
  • 49
Loading
Source Link
MickyT
  • 12.3k
  • 2
  • 27
  • 49
Loading