Quote:
Originally Posted by IsidroHidalgo
I think you have a typo, is'n it? For me

I have simulated 100K points using this formula for slope and taken the average. I have run this a number of times but each time I get a different slope all of which are small numbers like +/ 0.00X
The random points (x1, y1) and (x2, y2) I generated are all between 1 and 1. Is the slope I am getting small because the random numbers are between 1 and 1? After all, I am dividing by 100K.
Here's the code
double slope = ((x1*y1) + (x2*y2)) / ((x1*x1) + (x2*x2));
I sum the slopes for each point and compute average
AverageSlope = SumSlope / (double) NoOfPoints;