JavaScript Point implementation