Commit e91b75cf authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Fixed #11: Improved test of Vertex2D.distance()

(cherry picked from commit 3755063d)
parent 9e42bb29
...@@ -32,6 +32,12 @@ public class Vertex2DTest { ...@@ -32,6 +32,12 @@ public class Vertex2DTest {
public void distanceValidInput() { public void distanceValidInput() {
double distance = new Vertex2D(-1.2, 1.2).distance(new Vertex2D(1.3, 1.3)); double distance = new Vertex2D(-1.2, 1.2).distance(new Vertex2D(1.3, 1.3));
assertThat(distance).isBetween(2.5, 2.503); assertThat(distance).isBetween(2.5, 2.503);
distance = new Vertex2D(-1.2, -1.2).distance(new Vertex2D(1.3, 1.3));
assertThat(distance).isBetween(3.5, 3.6);
distance = new Vertex2D(1.2, 1.2).distance(new Vertex2D(1.3, 1.3));
assertThat(distance).isBetween(0.1, 0.15);
distance = new Vertex2D(-1.2, -1.2).distance(new Vertex2D(-1.3, -1.3));
assertThat(distance).isBetween(0.1, 0.15);
} }
@Test @Test
......
Supports Markdown
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