C#_Multiple attractor points

Hello,
I have a pattern which is responding to the point. I want to add more points so that pattern would respond to those multiple points. I could do that may be closest point component in grasshopper but how do I do that in c#?
find attached file pictures!

Any help would be great!

// finding distance between grid point to the attractor point
List<double> dist = new List<double>();

for(int i = 0; i < Grid.Count; i++)
{
  double d1 = x.DistanceTo(Grid[i]);
  dist.Add(d1);
}

// Remap Value formula = (value - from source)/(to source - from source)*(toTarget-fromTarget)+from target
List<double> tVal = new List<double>();
foreach(double d in dist)
{
  double dT = (d - dist.Min()) / (dist.Max() - dist.Min()) * (0.9 - 0) + 0;
  tVal.Add(dT);
}

pattern

06_Islamic Pattern.gh (10.4 KB)

Hi you could have a look at this Closest Points in RhinoCommon/C#

1 Like