My question is quite similar to this one. But what would be the solution in case of a rectangle with width W and length L??
Q1
I would like to find the average shortest distance between randomly distributed n points in a rectangle L xW. I would like to take each point the Euclidean distance to its nearest neighbor,and calculate the average distance over all points?
I was hoping if I could do the same simulation similar to @Henry's answer but I am not quite familiar to computing languages.
Q2
The second part of my question is if I could assign the coordinates of some points in the rectangle. For example, I would like to add some conditions that points cannot be distributed in the grey shaded area in this rectangle. Image here Thus the points can be distributed randomly over the area of the rectangle except for the shaded gray area. What would be the average shortest distance between randomly distributed n number of points ?
I would sincerely appreciate some help.