internal Coordinates CreateNearRandom(MinMaxD minMax) { double randX = minMax.GetValue() * Toolbox.RandomFrom(1, -1); double randY = minMax.GetValue() * Toolbox.RandomFrom(1, -1); return(new Coordinates(X + randX, Y + randY)); }
internal static Coordinates CreateRandom(MinMaxD minMax) { return(FromAngleInDegrees(Toolbox.RandomDouble(360.0)) * minMax.GetValue()); }
internal static Coordinates CreateRandom(Coordinates coordinates, MinMaxD minMax) => FromAngleAndDistance(coordinates, minMax, Toolbox.RandomDouble(360.0));
internal static Coordinates FromAngleAndDistance(Coordinates coordinates, MinMaxD distanceMinMax, double angle) { return(new Coordinates( coordinates.X + distanceMinMax.GetValue() * Math.Cos(angle * Toolbox.DEGREES_TO_RADIANS), coordinates.Y + distanceMinMax.GetValue() * Math.Sin(angle * Toolbox.DEGREES_TO_RADIANS))); }