private static List<Area> AllPossibleAreas(InclusiveRange realAxis, InclusiveRange imaginaryAxis, double gridSize) { var allAreas = new List<Area>(); var realPoints = new List<double>(); for (var realPoint = realAxis.Minimum; realPoint <= realAxis.Maximum; realPoint += gridSize) { realPoints.Add(realPoint); } var imaginaryPoints = new List<double>(); for (var imaginaryPoint = imaginaryAxis.Minimum; imaginaryPoint <= imaginaryAxis.Maximum; imaginaryPoint += gridSize) { imaginaryPoints.Add(imaginaryPoint); } for (var realIndex = 0; realIndex < realPoints.Count - 1; realIndex++) { for (var imaginaryIndex = 0; imaginaryIndex < imaginaryPoints.Count - 1; imaginaryIndex++) { var realRange = new InclusiveRange(realPoints[realIndex], realPoints[realIndex + 1]); var imaginaryRange = new InclusiveRange(imaginaryPoints[imaginaryIndex], imaginaryPoints[imaginaryIndex + 1]); var gridBox = new Area( realRange, imaginaryRange); allAreas.Add(gridBox); } } return allAreas; }
public Area(InclusiveRange realRange, InclusiveRange imaginaryRange) { RealRange = realRange; ImaginaryRange = imaginaryRange; _log = LogManager.GetLogger(GetType()); }
public double Next(InclusiveRange range) { return range.Magnitude * NextDouble() + range.Minimum; }