Commit 0f31c3b3 authored by Julian Zobel's avatar Julian Zobel 🦄
Browse files

PositionVector: Try to calculate distance towards the other given...

PositionVector: Try to calculate distance towards the other given location/position if not the same type of PositionVector
parent 71eb512d
......@@ -581,7 +581,15 @@ public class PositionVector implements Location {
"Can not compute distance between Vectors of different length!");
}
} else {
throw new AssertionError("Incompatible Types!");
try {
return dest.distanceTo(this);
}
catch (Exception e) {
throw new AssertionError("Incompatible Types!");
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment