/**
   * Computes the mean/average of two points.
   *
   * @param a (input) Point A
   * @param b (input) Point B
   * @param mean (output) average of 'a' and 'b'
   */
  public static Point2D_F32 mean(Point2D_F32 a, Point2D_F32 b, Point2D_F32 mean) {
    if (mean == null) mean = new Point2D_F32();

    mean.x = (a.x + b.x) / 2.0f;
    mean.y = (a.y + b.y) / 2.0f;

    return mean;
  }
  public static List<Point2D_F32> random(float min, float max, int num, Random rand) {
    List<Point2D_F32> ret = new ArrayList<Point2D_F32>();

    float d = max - min;

    for (int i = 0; i < num; i++) {
      Point2D_F32 p = new Point2D_F32();
      p.x = rand.nextFloat() * d + min;
      p.y = rand.nextFloat() * d + min;

      ret.add(p);
    }

    return ret;
  }
 public static void noiseNormal(List<Point2D_F32> pts, float sigma, Random rand) {
   for (Point2D_F32 p : pts) {
     p.x += (float) rand.nextGaussian() * sigma;
     p.y += (float) rand.nextGaussian() * sigma;
   }
 }