JS (Canvas) - distance()