-
Notifications
You must be signed in to change notification settings - Fork 59
/
random_data.html
970 lines (919 loc) · 31.6 KB
/
random_data.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
<html>
<head>
<title>
RANDOM_DATA - Generation of random data
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
RANDOM_DATA <br> Generation of random data
</h1>
<hr>
<p>
<b>RANDOM_DATA</b>
is a FORTRAN90 library which
generates sets of data points using certain
random number distributions, in a given dimension, and in a given
physical region.
</p>
<p>
Most of these routines assume that there is an available source
of pseudorandom numbers, distributed uniformly in the unit
interval [0,1]. In this package, that role is played by the
routine <b>R8_UNIFORM_01</b>, which allows us some portability.
We can get the same results in C, FORTRAN or MATLAB, for instance.
In general, however, it would be more efficient to use the
language-specific random number generator for this purpose.
</p>
<p>
If we have a source of pseudorandom values in [0,1], it's trivial
to generate pseudorandom points in any line segment; it's easy to
take pairs of pseudorandom values to sample a square, or triples to
sample a cube. It's easy to see how to deal with square region that
is translated from the origin, or scaled by different amounts in
either axis, or given a rigid rotation. The same simple transformations
can be applied to higher dimensional cubes, without giving us any
concern.
</p>
<p>
For all these simple shapes, which are just generalizations of
a square, we can easily see how to generate sample points that
we can guarantee will lie inside the region; in most cases, we
can also guarantee that these points will tend to be <i>uniformly
distributed</i>, that is, every subregion can expect to contain
a number of points proportional to its share of the total area.
</p>
<p>
However, we will <b>not</b> achieve uniform distribution in the
simple case of a rectangle of nonequal sides <b>[0,A]</b> x <b>[0,B]</b>,
if we naively scale the random values <b>(u1,u2)</b> to
<b>(A*u1,B*u2)</b>. In that case, the expected point density of
a wide, short region will differ from that of a narrow tall region.
The absence of uniformity is most obvious if the points are plotted.
</p>
<p>
If you realize that uniformity is desirable, and easily lost,
it is possible to adjust the approach so that rectangles are
properly handled.
</p>
<p>
But rectangles are much too simple. We are interested in circles,
triangles, and other shapes. Once the geometry of the region
becomes more "interesting", there are two common ways to continue.
</p>
<p>
In the <i>acceptance-rejection method</i>,
uniform points are generated in a superregion that encloses the
region. Then, points that do not lie within the region are rejected.
More points are generated until enough have been accepted to satisfy the
needs. If a circle was the region of interest, for instance, we
could surround it with a box, generate points in the box, and throw
away those points that don't actually lie in the circle. The resulting
set of samples will be a uniform sampling of the circle.
</p>
<p>
In the <i>direct mapping</i> method, a formula or mapping
is determined so that each time a set of values is taken from
the pseudorandom number generator, it is guaranteed to correspond
to a point in the region. For the circle problem, we can use
one uniform random number to choose an angle between 0 and 2 PI,
the other to choose a radius. (The radius must be chosen in
an appropriate way to guarantee uniformity, however.) Thus,
every time we input two uniform random values, we get a pair
(R,T) that corresponds to a point in the circle.
</p>
<p>
The acceptance-rejection method can be simple to program, and
can handle arbitrary regions. The direct mapping method is
less sensitive to variations in the aspect ratio of a region
and other irregularities. However, direct mappings are only
known for certain common mathematical shapes.
</p>
<p>
Points may also be generated according to a nonuniform density.
This creates an additional complication in programming. However,
there are some cases in which it is possible to use direct mapping
to turn a stream of scalar uniform random values into a set of
multivariate data that is governed by a normal distribution.
</p>
<p>
Another way to generate points replaces the uniform pseudorandom number
generator by a <i>quasirandom number generator</i>. The main difference
is that successive elements of a quasirandom sequence may be highly
correlated (bad for certain Monte Carlo applications) but will tend
to cover the region in a much more regular way than pseudorandom
numbers. Any process that uses uniform random numbers to carry out
sampling can easily be modified to do the same sampling with
a quasirandom sequence like the Halton sequence, for instance.
</p>
<p>
The library includes a routine that can write the resulting
data points to a file.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>RANDOM_DATA</b> is available in
<a href = "../../cpp_src/random_data/random_data.html">a C++ version</a> and
<a href = "../../f_src/random_data/random_data.html">a FORTRAN90 version</a> and
<a href = "../../m_src/random_data/random_data.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/asa183/asa183.html">
ASA183</a>,
a FORTRAN90 library which
implements the Wichman-Hill pseudorandom number generator.
</p>
<p>
<a href = "../../f_src/discrete_pdf_sample/discrete_pdf_sample.html">
DISCRETE_PDF_SAMPLE</a>,
a FORTRAN90 program which
demonstrates how to construct a Probability Density Function (PDF)
from a table of sample data, and then to use that PDF to create new samples.
</p>
<p>
<a href = "../../c_src/rbox/rbox.html">
RBOX</a>,
a C program which
produces random data from a number of regions.
</p>
<p>
<a href = "../../cpp_src/rsites/rsites.html">
RSITES</a>,
a C++ program which
produces random data in an M-dimensional box.
</p>
<p>
<a href = "../../f_src/simplex_coordinates/simplex_coordinates.html">
SIMPLEX_COORDINATES</a>,
a FORTRAN90 library which
computes the Cartesian coordinates of the vertices of a regular
simplex in M dimensions.
</p>
<p>
<a href = "../../data/table/table.html">
TABLE</a>,
a file format which
is used for the output of <b>RANDOM_DATA</b>.
</p>
<p>
<a href = "../../datasets/tetrahedron_samples/tetrahedron_samples.html">
TETRAHEDRON_SAMPLES</a>,
a dataset directory which
contains examples of sets of sample points from the unit tetrahedron.
</p>
<p>
<a href = "../../f_src/triangle_grid/triangle_grid.html">
TRIANGLE_GRID</a>,
a FORTRAN90 library which
computes a triangular grid of points.
</p>
<p>
<a href = "../../f_src/triangle_histogram/triangle_histogram.html">
TRIANGLE_HISTOGRAM</a>,
a FORTRAN90 program which
computes histograms of data on the unit triangle.
</p>
<p>
<a href = "../../f_src/triangle_monte_carlo/triangle_monte_carlo.html">
TRIANGLE_MONTE_CARLO</a>,
a FORTRAN90 program which
uses the Monte Carlo method to estimate integrals over a triangle.
</p>
<p>
<a href = "../../datasets/triangle_samples/triangle_samples.html">
TRIANGLE_SAMPLES</a>,
a dataset directory which
contains examples of sets of sample points from the unit triangle.
</p>
<p>
<a href = "../../f_src/uniform/uniform.html">
UNIFORM</a>,
a FORTRAN90 library which
samples the uniform
random distribution.
</p>
<p>
<a href = "../../m_src/xyz_display/xyz_display.html">
XYZ_DISPLAY</a>,
a MATLAB program which
reads XYZ information defining points in 3D,
and displays an image in the MATLAB graphics window.
</p>
<p>
<a href = "../../cpp_src/xyz_display_opengl/xyz_display_opengl.html">
XYZ_DISPLAY_OPENGL</a>,
a C++ program which
reads XYZ information defining points in 3D,
and displays an image using OpenGL.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Milton Abramowitz, Irene Stegun,<br>
Handbook of Mathematical Functions,<br>
National Bureau of Standards, 1964,<br>
ISBN: 0-486-61272-4,<br>
LC: QA47.A34.
</li>
<li>
James Arvo,<br>
Stratified sampling of spherical triangles,<br>
Computer Graphics Proceedings, Annual Conference Series, <br>
ACM SIGGRAPH '95, pages 437-438, 1995.
</li>
<li>
Gerard Bashein, Paul Detmer,<br>
Centroid of a Polygon,<br>
in Graphics Gems IV,<br>
edited by Paul Heckbert,<br>
AP Professional, 1994,<br>
ISBN: 0123361559,<br>
LC: T385.G6974.
</li>
<li>
Paul Bratley, Bennett Fox, Linus Schrage,<br>
A Guide to Simulation,<br>
Second Edition,<br>
Springer, 1987,<br>
ISBN: 0387964673,<br>
LC: QA76.9.C65.B73.
</li>
<li>
Russell Cheng,<br>
Random Variate Generation,<br>
in Handbook of Simulation,<br>
edited by Jerry Banks,<br>
Wiley, 1998,<br>
ISBN: 0471134031,<br>
LC: T57.62.H37.
</li>
<li>
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,<br>
LINPACK User's Guide,<br>
SIAM, 1979,<br>
ISBN13: 978-0-898711-72-1,<br>
LC: QA214.L56.
</li>
<li>
John Halton,<br>
On the efficiency of certain quasi-random sequences of points
in evaluating multi-dimensional integrals,<br>
Numerische Mathematik,<br>
Volume 2, Number 1, December 1960, pages 84-90.
</li>
<li>
John Halton, GB Smith,<br>
Algorithm 247:
Radical-Inverse Quasi-Random Point Sequence,<br>
Communications of the ACM,<br>
Volume 7, Number 12, December 1964, pages 701-702.
</li>
<li>
John Hammersley,<br>
Monte Carlo methods for solving multivariable problems,<br>
Proceedings of the New York Academy of Science,<br>
Volume 86, 1960, pages 844-874.
</li>
<li>
Ladislav Kocis, William Whiten,<br>
Computational Investigations of Low-Discrepancy Sequences,<br>
ACM Transactions on Mathematical Software,<br>
Volume 23, Number 2, June 1997, pages 266-294.
</li>
<li>
Pierre LEcuyer,<br>
Random Number Generation,<br>
in Handbook of Simulation,<br>
edited by Jerry Banks,<br>
Wiley, 1998,<br>
ISBN: 0471134031,<br>
LC: T57.62.H37.
</li>
<li>
Albert Nijenhuis, Herbert Wilf,<br>
Combinatorial Algorithms for Computers and Calculators,<br>
Second Edition,<br>
Academic Press, 1978,<br>
ISBN: 0-12-519260-6,<br>
LC: QA164.N54.
</li>
<li>
Claudio Rocchini, Paolo Cignoni,<br>
Generating Random Points in a Tetrahedron,<br>
Journal of Graphics Tools,<br>
Volume 5, Number 4, 2000, pages 9-12.
</li>
<li>
Reuven Rubinstein,<br>
Monte Carlo Optimization, Simulation and Sensitivity of
Queueing Networks,<br>
Krieger, 1992,<br>
ISBN: 0894647644,<br>
LC: QA298.R79.
</li>
<li>
Peter Shirley,<br>
Nonuniform Random Point Sets Via Warping,<br>
in Graphics Gems III,<br>
edited by David Kirk,<br>
Academic Press, 1992,<br>
ISBN: 0124096735,<br>
LC: T385.G6973
</li>
<li>
Greg Turk,<br>
Generating Random Points in a Triangle,<br>
in Graphics Gems I,<br>
edited by Andrew Glassner,<br>
AP Professional, 1990,<br>
ISBN: 0122861663,<br>
LC: T385.G697
</li>
<li>
Daniel Zwillinger, editor,<br>
CRC Standard Mathematical Tables and Formulae,<br>
30th Edition,<br>
CRC Press, 1996,<br>
ISBN: 0-8493-2479-3,<br>
LC: QA47.M315.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "random_data.f90">random_data.f90</a>,
the source code.
</li>
<li>
<a href = "random_data.sh">random_data.sh</a>,
commands to compile the source code
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "random_data_prb.f90">random_data_prb.f90</a>,
the sample calling program.
</li>
<li>
<a href = "random_data_prb.sh">random_data_prb.sh</a>,
commands to compile, link and run the sample calling program.
</li>
<li>
<a href = "random_data_prb_output.txt">random_data_prb_output.txt</a>,
output from the sample calling program.
</li>
</ul>
</p>
<p>
The sample calling program generates sets of points:
<ul>
<li>
<a href = "bad_in_tetrahedron.txt">bad_in_tetrahedron.txt</a>,
points in the unit tetrahedron, not uniformly chosen.
</li>
<li>
<a href = "bad_in_triangle.txt">bad_in_triangle.txt</a>,
points in the unit triangle, not uniformly chosen.
</li>
<li>
<a href = "brownian.txt">brownian.txt</a>, Brownian motion.
</li>
<li>
<a href = "brownian.png">brownian.png</a>
</li>
<li>
<a href = "grid_in_cube01.txt">grid_in_cube01.txt</a>,
grid points in the unit hypercube, with CENTER = 1.
</li>
<li>
<a href = "grid_in_cube01.png">grid_in_cube01.png</a>
</li>
<li>
<a href = "halton_in_circle01_accept.txt">
halton_in_circle01_accept.txt</a>,
Halton points in the unit circle by acceptance/rejection.
</li>
<li>
<a href = "halton_in_circle01_accept.png">
halton_in_circle01_accept.png</a>
</li>
<li>
<a href = "halton_in_circle01_map.txt">
halton_in_circle01_map.txt</a>,
Halton points in the unit circle by direct mapping.
</li>
<li>
<a href = "halton_in_circle01_map.png">
halton_in_circle01_map.png</a>
</li>
<li>
<a href = "halton_in_cube01.txt">halton_in_cube01.txt</a>,
Halton points in the unit hypercube.
</li>
<li>
<a href = "halton_in_cube01.png">halton_in_cube01.png</a>
</li>
<li>
<a href = "hammersley_in_cube01.txt">
hammersley_in_cube01.txt</a>, Hammersley points in the unit hypercube.
</li>
<li>
<a href = "hammersley_in_cube01.png">hammersley_in_cube01.png</a>
</li>
<li>
<a href = "normal.txt">normal.txt</a>, normal points, with
strong correlation between the two coordinates.
</li>
<li>
<a href = "normal.png">normal.png</a>
</li>
<li>
<a href = "normal_circular.txt">normal_circular.txt</a>,
circular normal points.
</li>
<li>
<a href = "normal_circular.png">normal_circular.png</a>
</li>
<li>
<a href = "normal_simple.txt">normal_simple.txt</a>,
normal points in which there is no correlation between the
X and Y coordinates.
</li>
<li>
<a href = "normal_simple.png">normal_simple.png</a>
</li>
<li>
<a href = "polygon_vertices.txt">polygon_vertices.txt</a>,
the vertices of a polygon to be filled by random points.
</li>
<li>
<a href = "polygon_vertices.png">polygon_vertices.png</a>,
</li>
<li>
<a href = "uniform_in_annulus.txt">
uniform_in_annulus.txt</a>,
uniform random points in an annulus, mappint.
</li>
<li>
<a href = "uniform_in_annulus.png">
uniform_in_annulus.png</a>,
</li>
<li>
<a href = "uniform_in_annulus_accept.txt">
uniform_in_annulus_accept.txt</a>,
uniform random points in an annulus, acceptance/rejection.
</li>
<li>
<a href = "uniform_in_annulus_accept.png">
uniform_in_annulus_accept.png</a>,
</li>
<li>
<a href = "uniform_in_annulus_sector.txt">
uniform_in_annulus_sector.txt</a>,
uniform random points in an annulus sector, mapping.
</li>
<li>
<a href = "uniform_in_annulus_sector.png">
uniform_in_annulus_sector.png</a>,
</li>
<li>
<a href = "uniform_in_cube01.txt">uniform_in_cube01.txt</a>,
uniform random points in the unit hypercube.
</li>
<li>
<a href = "uniform_in_cube01.png">uniform_in_cube01.png</a>,
</li>
<li>
<a href = "uniform_in_circle01_map.txt">
uniform_in_circle01_map.txt</a>,
uniform random points in the unit circle.
</li>
<li>
<a href = "uniform_in_circle01_map.png">
uniform_in_circle01_map.png</a>,
</li>
<li>
<a href = "uniform_in_ellipsoid_map.txt">uniform_in_ellipsoid_map.txt</a>,
uniform random points in an ellipsoid.
</li>
<li>
<a href = "uniform_in_ellipsoid_map.png">
uniform_in_ellipsoid_map.png</a>,
</li>
<li>
<a href = "uniform_in_parallelogram_map.txt">
uniform_in_parallelogram_map.txt</a>,
uniform random points in a parallelogram.
</li>
<li>
<a href = "uniform_in_parallelogram_map.png">
uniform_in_parallelogram_map.png</a>,
</li>
<li>
<a href = "uniform_in_polygon_map.txt">
uniform_in_polygon_map.txt</a>,
uniform random points in a polygon (a star, in this case).
</li>
<li>
<a href = "uniform_in_polygon_map.png">uniform_in_polygon_map.png</a>,
</li>
<li>
<a href = "uniform_in_sector_map.txt">
uniform_in_sector_map.txt</a>,
uniform random points in a circular sector.
</li>
<li>
<a href = "uniform_in_sector_map.png">uniform_in_sector_map.png</a>,
</li>
<li>
<a href = "uniform_in_simplex01_map.txt">
uniform_in_simplex01_map.txt</a>,
uniform random points in the unit simplex.
</li>
<li>
<a href = "uniform_in_simplex01_map.png">
uniform_in_simplex01_map.png</a>,
</li>
<li>
<a href = "uniform_in_sphere01_map.txt">
uniform_in_sphere01_map.txt</a>,
uniform random points in the unit sphere.
</li>
<li>
<a href = "uniform_in_sphere01_map.png">
uniform_in_sphere01_map.png</a>,
</li>
<li>
<a href = "uniform_in_tetrahedron.txt">
uniform_in_tetrahedron.txt</a>,
uniform random points in an arbitrary tetrahedron.
</li>
<li>
<a href = "uniform_in_triangle_map1.txt">
uniform_in_triangle_map1.txt</a>,
uniform random points in an arbitrary triangle, Turk method 1.
</li>
<li>
<a href = "uniform_in_triangle_map1.png">
uniform_in_triangle_map1.png</a>,
</li>
<li>
<a href = "uniform_in_triangle_map2.txt">
uniform_in_triangle_map2.txt</a>,
uniform random points in an arbitrary triangle, Turk method 2.
</li>
<li>
<a href = "uniform_in_triangle_map2.png">
uniform_in_triangle_map2.png</a>,
</li>
<li>
<a href = "uniform_in_triangle01_map.txt">
uniform_in_triangle01_map.txt</a>,
uniform random points in the unit triangle.
</li>
<li>
<a href = "uniform_in_triangle01_map.png">
uniform_in_triangle01_map.png</a>,
</li>
<li>
<a href = "uniform_on_hemisphere01_phong.txt">
uniform_on_hemisphere01_phong.txt</a>,
uniform random points on a hemisphere, Phong distribution.
</li>
<li>
<a href = "uniform_on_ellipsoid_map.txt">
uniform_on_ellipsoid_map.txt</a>,
uniform random points on an ellipsoid.
</li>
<li>
<a href = "uniform_on_ellipsoid_map.png">
uniform_on_ellipsoid_map.png</a>,
</li>
<li>
<a href = "uniform_on_simplex01_map.txt">
uniform_on_simplex01_map.txt</a>,
uniform random points on the unit simplex.
</li>
<li>
<a href = "uniform_on_simplex01_map.png">
uniform_on_simplex01_map.png</a>,
</li>
<li>
<a href = "uniform_on_sphere01_map.txt">
uniform_on_sphere01_map.txt</a>,
uniform random points on the unit sphere in 2D.
</li>
<li>
<a href = "uniform_on_sphere01_map.png">
uniform_on_sphere01_map.png</a>,
</li>
<li>
<a href = "uniform_on_sphere01_patch_tp.txt">
uniform_on_sphere01_patch_tp.txt</a>,
uniform random points on an TP (theta,phi) "patch" of the unit sphere in 3D.
</li>
<li>
<a href = "uniform_on_sphere01_patch_tp.png">
uniform_on_sphere01_patch_tp.png</a>
</li>
<li>
<a href = "uniform_on_sphere01_patch_xyz.txt">
uniform_on_sphere01_patch_xyz.txt</a>,
uniform random points on an XYZ "patch" of the unit sphere in 3D.
</li>
<li>
<a href = "uniform_on_sphere01_patch_xyz.png">
uniform_on_sphere01_patch_xyz.png</a>
</li>
<li>
<a href = "uniform_on_sphere01_triangle_xyz.txt">
uniform_on_sphere01_triangle_xyz.txt</a>,
uniform random points on a spherical triangle of the unit sphere in 3D
using XYZ coordinates.
</li>
<li>
<a href = "uniform_walk.txt">uniform_walk.txt</a>,
points on a uniform random walk.
</li>
<li>
<a href = "uniform_walk.png">uniform_walk.png</a>,
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>ARC_COSINE</b> computes the arc cosine function, with argument truncation.
</li>
<li>
<b>BAD_IN_SIMPLEX01</b> is a "bad" (nonuniform) sampling of the unit simplex.
</li>
<li>
<b>BROWNIAN</b> creates Brownian motion points.
</li>
<li>
<b>DPO_FA</b> factors a DPO matrix.
</li>
<li>
<b>DPO_SL</b> solves a DPO system factored by DPO_FA.
</li>
<li>
<b>DIRECTION_UNIFORM_ND</b> generates a random direction vector.
</li>
<li>
<b>GET_UNIT</b> returns a free FORTRAN unit number.
</li>
<li>
<b>GRID_IN_CUBE01</b> generates grid points in the unit hypercube.
</li>
<li>
<b>GRID_SIDE</b> finds the smallest grid containing at least N points.
</li>
<li>
<b>HALHAM_LEAP_CHECK</b> checks LEAP for a Halton or Hammersley sequence.
</li>
<li>
<b>HALHAM_N_CHECK</b> checks N for a Halton or Hammersley sequence.
</li>
<li>
<b>HALHAM_DIM_NUM_CHECK</b> checks DIM_NUM for a Halton or Hammersley sequence.
</li>
<li>
<b>HALHAM_SEED_CHECK</b> checks SEED for a Halton or Hammersley sequence.
</li>
<li>
<b>HALHAM_STEP_CHECK</b> checks STEP for a Halton or Hammersley sequence.
</li>
<li>
<b>HALTON_BASE_CHECK</b> checks BASE for a Halton sequence.
</li>
<li>
<b>HALTON_IN_CIRCLE01_ACCEPT</b> accepts Halton points in the unit circle.
</li>
<li>
<b>HALTON_IN_CIRCLE01_MAP</b> maps Halton points into the unit circle.
</li>
<li>
<b>HALTON_IN_CUBE01</b> generates Halton points in the unit hypercube.
</li>
<li>
<b>HAMMERSLEY_BASE_CHECK</b> is TRUE if BASE is legal.
</li>
<li>
<b>HAMMERSLEY_IN_CUBE01</b> generates Hammersley points in the unit hypercube.
</li>
<li>
<b>I4_FACTORIAL</b> computes the factorial N!
</li>
<li>
<b>I4_MODP</b> returns the nonnegative remainder of integer division.
</li>
<li>
<b>I4_TO_HALTON</b> computes one element of a leaped Halton subsequence.
</li>
<li>
<b>I4_TO_HALTON_SEQUENCE</b> computes N elements of a leaped Halton subsequence.
</li>
<li>
<b>I4_TO_HAMMERSLEY</b> computes one element of a leaped Hammersley subsequence.
</li>
<li>
<b>I4_TO_HAMMERSLEY_SEQUENCE:</b> N elements of a leaped Hammersley subsequence.
</li>
<li>
<b>I4_UNIFORM</b> returns a scaled pseudorandom I4.
</li>
<li>
<b>I4VEC_TRANSPOSE_PRINT</b> prints an I4VEC "transposed".
</li>
<li>
<b>KSUB_RANDOM2</b> selects a random subset of size K from a set of size N.
</li>
<li>
<b>NORMAL</b> creates normally distributed points.
</li>
<li>
<b>NORMAL_CIRCULAR</b> creates circularly normal points.
</li>
<li>
<b>NORMAL_MULTIVARIATE</b> samples a multivariate normal distribution.
</li>
<li>
<b>NORMAL_SIMPLE</b> creates normally distributed points.
</li>
<li>
<b>POLYGON_CENTROID_2D</b> computes the centroid of a polygon in 2D.
</li>
<li>
<b>PRIME</b> returns any of the first PRIME_MAX prime numbers.
</li>
<li>
<b>R8_NORMAL_01</b> returns a unit pseudonormal R8.
</li>
<li>
<b>R8_UNIFORM_01</b> returns a unit pseudorandom R8.
</li>
<li>
<b>R8MAT_PRINT</b> prints a R8MAT.
</li>
<li>
<b>R8MAT_PRINT_SOME</b> prints some of an R8MAT.
</li>
<li>
<b>R8MAT_UNIFORM_01</b> returns a unit pseudorandom R8MAT.
</li>
<li>
<b>R8MAT_WRITE</b> writes an R8MAT file.
</li>
<li>
<b>R8VEC_NORM</b> returns the L2 norm of an R8VEC.
</li>
<li>
<b>R8VEC_NORMAL_01</b> returns a unit pseudonormal R8VEC.
</li>
<li>
<b>R8VEC_PRINT</b> prints a R8VEC.
</li>
<li>
<b>R8VEC_UNIFORM_01</b> returns a unit pseudorandom R8VEC.
</li>
<li>
<b>SCALE_FROM_SIMPLEX01</b> rescales data from a unit to non-unit simplex.
</li>
<li>
<b>SCALE_TO_BALL01</b> translates and rescales data to fit within the unit ball.
</li>
<li>
<b>SCALE_TO_BLOCK01</b> translates and rescales data to fit in the unit block.
</li>
<li>
<b>SCALE_TO_CUBE01</b> translates and rescales data to the unit hypercube.
</li>
<li>
<b>STRI_ANGLES_TO_AREA</b> computes the area of a spherical triangle.
</li>
<li>
<b>STRI_SIDES_TO_ANGLES</b> computes spherical triangle angles.
</li>
<li>
<b>STRI_VERTICES_TO_SIDES_3D</b> computes spherical triangle sides.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
<li>
<b>TRIANGLE_AREA_2D</b> computes the area of a triangle in 2D.
</li>
<li>
<b>TUPLE_NEXT_FAST</b> computes the next element of a tuple space, "fast".
</li>
<li>
<b>UNIFORM_IN_ANNULUS</b> samples a circular annulus.
</li>
<li>
<b>UNIFORM_IN_ANNULUS_ACCEPT</b> accepts points in an annulus.
</li>
<li>
<b>UNIFORM_IN_ANNULUS_SECTOR</b> samples an annular sector in 2D.
</li>
<li>
<b>UNIFORM_IN_CIRCLE01_MAP</b> maps uniform points into the unit circle.
</li>
<li>
<b>UNIFORM_IN_CUBE01</b> creates uniform points in the unit hypercube.
</li>
<li>
<b>UNIFORM_IN_ELLIPSOID_MAP</b> maps uniform points into an ellipsoid.
</li>
<li>
<b>UNIFORM_IN_PARALLELOGRAM_MAP</b> maps uniform points into a parallelogram.
</li>
<li>
<b>UNIFORM_IN_POLYGON_MAP</b> maps uniform points into a polygon.
</li>
<li>
<b>UNIFORM_IN_SECTOR_MAP</b> maps uniform points into a circular sector.
</li>
<li>
<b>UNIFORM_IN_SIMPLEX01_MAP</b> maps uniform points into the unit simplex.
</li>
<li>
<b>UNIFORM_IN_SPHERE01_MAP</b> maps uniform points into the unit sphere.
</li>
<li>
<b>UNIFORM_IN_TETRAHEDRON</b> returns uniform points in a tetrahedron.
</li>
<li>
<b>UNIFORM_IN_TRIANGLE_MAP1</b> maps uniform points into a triangle.
</li>
<li>
<b>UNIFORM_IN_TRIANGLE_MAP2</b> maps uniform points into a triangle.
</li>
<li>
<b>UNIFORM_IN_TRIANGLE01_MAP</b> maps uniform points into the unit triangle.
</li>
<li>
<b>UNIFORM_ON_ELLIPSOID_MAP</b> maps uniform points onto an ellipsoid.
</li>
<li>
<b>UNIFORM_ON_HEMISPHERE01_PHONG</b> maps uniform points onto the unit hemisphere.
</li>
<li>
<b>UNIFORM_ON_SIMPLEX01_MAP</b> maps uniform points onto the unit simplex.
</li>
<li>
<b>UNIFORM_ON_SPHERE01_MAP</b> maps uniform points onto the unit sphere.
</li>
<li>
<b>UNIFORM_ON_SPHERE01_PATCH_TP</b> maps uniform points onto a spherical TP patch.
</li>
<li>
<b>UNIFORM_ON_SPHERE01_PATCH_XYZ</b> maps uniform points to a spherical XYZ patch.
</li>
<li>
<b>UNIFORM_ON_SPHERE01_TRIANGLE_XYZ:</b> sample spherical triangle, XYZ coordinates.
</li>
<li>
<b>UNIFORM_WALK</b> generates points on a uniform random walk.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../f_src.html">
the FORTRAN90 source codes</a>.
</p>
<hr>
<i>
Last revised on 24 August 2009.
</i>
<!-- John Burkardt -->
</body>
</html>