Sine/cosine 3d wave graph in c#

Hi!

I really liked this surface expression refer to this youtube tutorial ;

And I was wondering if there is a way to make it in C# script.
I tried the equation z = Math.Sin(Math.Sqrt(xx+yy)) but I don’t know how to apply this equation in multiple (random) center points. That equation creates only one wave in grid points.

Is there any math genius person who can give me an advice?
Thanks!! :slight_smile:

pts = new Point3dList(randomPoints);
d = gridPointij.DistanceTo(pts[pts.ClosestIndex(gridPointij)]);
z = Math.Sin(d * someFactor);