Hi, people. I passed the task because I copied the magical formula of the other help topic. But I didn't understand.
To calculate the distance, we use
double distance = Math.sqrt(Math.pow((this.getX() - o.getX()), 2.0) + Math.pow((this.getY() - o.getY()), 2.0));
And... what is it?
I should have known it before reaching this task? I mean, that's not even close to trivial to me. I've read the java.lang.Math sqrt and pow methods, but it's still very hard for me to see the application of those here.
The knowledge of math is a prereq to do this task? Or is it possible to achieve this solution, or come across with this formula through other means?
So, if someone out there can explain it to me I will be very grateful.
Thanks.