/// <summary> /// Generates a new random point /// </summary> /// <returns>The random point</returns> private MPoint GenerateRandomPoint() { float x = GenerateRandomValue(); float y = GenerateRandomValue(); double ratio = Math.Sqrt(x * x + y * y); bool insideCircle = ratio <= 0.5; MPoint newOne = new MPoint(x, y, insideCircle); return(newOne); }
/// <summary> /// Use this method to generate a new point. /// </summary> public void GeneratePoint() { MPoint newPoint = GenerateRandomPoint(); this.points.Add(newPoint); }