Example #1
0
        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));
        }
Example #2
0
 internal static Coordinates CreateRandom(MinMaxD minMax)
 {
     return(FromAngleInDegrees(Toolbox.RandomDouble(360.0)) * minMax.GetValue());
 }
Example #3
0
 internal static Coordinates CreateRandom(Coordinates coordinates, MinMaxD minMax) => FromAngleAndDistance(coordinates, minMax, Toolbox.RandomDouble(360.0));
Example #4
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)));
 }