Files

21 lines
522 B
C#
Raw Permalink Normal View History

2025-05-13 04:46:54 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class GaussFunction : Function2D {
public double a;
public double b;
public double c = 1.0;
public bool NormalDistrubution = true;
public override double Evaluate(double u, double v) {
double x = Math.Sqrt(u * u + v * v);
double aValue = NormalDistrubution ? (1.0 / (c * Math.Sqrt(2.0 * Math.PI))) : a;
return aValue * Math.Exp(-(((x - b)* (x - b)) / (2*c*c)));
}
}