I'm looking to plot random points inside a box with radius of 5 and then implement an algorithm to form a closed polygonal path that passes through all these points.
Right now, I have a for loop to get my x,y coords for each of my points. N is defined by user input for the number of random points we want to display. Next, I plan to plot them using the x and y value. However, I have no idea how to connect them via a closed polygonal path. Any ideas?
for (int point = 0; point < N; point++ ){
double x = coords.nextDouble() * 10.0 - 5.0; // x and y coords for random point between -5 and 5
double y = coords.nextDouble() * 10.0 - 5.0;