From abc1867d7cf1ab67dc0b9a108618c98c334a8d41 Mon Sep 17 00:00:00 2001 From: Emux Date: Fri, 8 Sep 2017 20:42:33 +0300 Subject: [PATCH] Fix Point distance --- vtm/src/org/oscim/core/Point.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vtm/src/org/oscim/core/Point.java b/vtm/src/org/oscim/core/Point.java index 1c43d0a3..18d44747 100644 --- a/vtm/src/org/oscim/core/Point.java +++ b/vtm/src/org/oscim/core/Point.java @@ -1,5 +1,6 @@ /* * Copyright 2013 Hannes Janetzek + * Copyright 2017 devemux86 * * This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * @@ -37,11 +38,11 @@ public class Point { } public double distance(Point other) { - return Math.sqrt((x - other.x) * (x - other.x) + (y - other.y) + (y - other.y)); + return Math.sqrt((x - other.x) * (x - other.x) + (y - other.y) * (y - other.y)); } public double distanceSq(Point other) { - return (x - other.x) * (x - other.x) + (y - other.y) + (y - other.y); + return (x - other.x) * (x - other.x) + (y - other.y) * (y - other.y); } @Override