If you’re gonna return a new array, why would you need to pass an empty array?
You could simply return a new array regardless.
Besides, you’re actually passing an array w/ length 20 to your function coord():
float [] locArr = new float[20];
coord(locArr);
And inside coord() you fill up the array w/ a range value 0 to 1.