We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 19
Weather Observation Station 19
Sort by
recency
|
2073 Discussions
|
Please Login in order to post a comment
MySQL
I used POWER function with 1/2 as second parameter to do the square root, but SQRT function can be used instead.
Euclidean Distance is nothing but actually a distance between 2 points on a cartesian plane for which the formula is d=√((x_2-x_1)²+(y_2-y_1)²)
SOLUTION SELECT ROUND(SQRT(POW(MAX(LAT_N)-MIN(LAT_N),2) + POW(MAX(LONG_W)-MIN(LONG_W),2)) , 4) FROM STATION;
select ROUND(SQRT(POWER(MAX(LAT_N)-MIN(LAT_N),2)+ POWER(MAX(LAT_N)-MIN(LAT_N),2)),4) from STATION;
SELECT FORMAT( SQRT( POWER( MAX(LAT_N) - MIN(LAT_N), 2) + POWER(MAX(LONG_W) - MIN(LONG_W), 2) ), 'N4') AS euclidean_distance FROM STATION;