Anonymous user
Constrained random points on a circle: Difference between revisions
Constrained random points on a circle (view source)
Revision as of 15:47, 30 March 2020
, 4 years ago→{{header|Standard ML}}
(→{{header|Swift}}: + Standard ML) |
|||
Line 3,452:
=={{header|Standard ML}}==
Works with PolyML. Plotting function from 'Draw a pixel' task. Uniform random generator: copy from [[Random_numbers#Standard_ML]]. x,y plotted scaled x 10 px
<lang Standard ML>open XWindows ;
open Motif ;
Line 3,490:
val usum = fn (u,v) => u*(u-1.0) + v*(v-1.0) ;
val lim = ( ~350.0/900.0, ~225.0/900.0 ) ; (* limits to usum *)
val select = fn i
val uv = ListPair.zip ( urandomlist (#1 realseeds) 2500 , urandomlist (#2 realseeds) 2500 ) (* draw 2500 couples *)
in
|