So that if have to break for if there are same values as you can see in first one it's all ok but in another ones it just failed I don't know why.
[-100.0, -100.0]; [-100.0, -100.0]
0; 5
true
...
Type: Posts; User: Slapy
So that if have to break for if there are same values as you can see in first one it's all ok but in another ones it just failed I don't know why.
[-100.0, -100.0]; [-100.0, -100.0]
0; 5
true
...
Try to add this
System.out.println(vertices[0] +"; "+ pol.getVertex(i)); before
if (vertices[0].equals(pol.getVertex(i) ) ) break; and you will see it have to break that shitty for but it doesn't...
Sorry for duplicate I don't know how to delete it.
yes I am sure and like I said values of 4 digits: 0 5 5 5 have to be numbers of variable in array with match but it doesn't.
--- Update ---
It's just little bit different. First number have to...
it's value of int i but like I said output have to be 0 3 1 1 or 1 4 2 2 not 0 5 5 5 and there is no case when match is not found so I think it's not necessary to fix.
Edit: so value of i have to...
basically I am comparing two instances of class Vertex 2D.
int i = 0;
for (; i < vertices.length; i++) {
if (vertices[0].equals(pol.getVertex(i) ) ) break;
}
public abstract class SimplePolygon {
public abstract Vertex2D getVertex(int index) throws IllegalArgumentException;
public abstract int getNumVertices();
public double getArea() {
...