Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/14/2020 in all areas

  1. I assumed that they knew how to calculate the distance and just needed some pointers on how to structure the algorithm in PHP.
    1 point
  2. Based on this page, the Euclidean distance function requires 2 points (p1, p2) so a function to calculate it would be something like this: function EuclideanDistance($p1x, $p1y, $p2x, $p2y) { return sqrt(pow($p1x - $p2x, 2) + pow($p1y - $p2y, 2)); }
    1 point
  3. 1 and 2 would presumably be input from the web page. The rest would be something like: for ($m=1; $m<=$M; $m++) { for ($l=1; $l<=$L; $l++) { for ($j=1; $j<=$N; $j++) { #do calculation here storing it in a 2D array } # select minimum here (perhaps min() function) } } # use array sort # use PHP vector class # compute distance from vectors # echo results in desired format
    1 point
  4. Either you should not be GROUPing BY the confno, or you should not be GROUPing BY and instead be searching only for a particular confno, or you should be including more data in the form so it's obvious that those three boxes are for three different confno values.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.