Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows;
|
---|
| 6 |
|
---|
| 7 | namespace Microsoft.Research.DynamicDataDisplay.Common
|
---|
| 8 | {
|
---|
| 9 | internal static class RandomExtensions
|
---|
| 10 | {
|
---|
| 11 | public static Point NextPoint(this Random rnd)
|
---|
| 12 | {
|
---|
| 13 | return new Point(rnd.NextDouble(), rnd.NextDouble());
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | public static Point NextPoint(this Random rnd, double xMin, double xMax, double yMin, double yMax)
|
---|
| 17 | {
|
---|
| 18 | double x = rnd.NextDouble() * (xMax - xMin) + xMin;
|
---|
| 19 | double y = rnd.NextDouble() * (yMax - yMin) + yMin;
|
---|
| 20 | return new Point(x, y);
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public static Vector NextVector(this Random rnd)
|
---|
| 24 | {
|
---|
| 25 | return new Vector(rnd.NextDouble(), rnd.NextDouble());
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.