Hi guys, I've been dealing with these for about 2 days now!!! So fricken difficult!!! Here's how.. Example input:
Code:
java ShapeTest -2 -1 2 -1 -1 1 1 1
each of the numbers represent the points on the (x, y) coordinates. (-2, -1), (2, -1) and so on.. I'm trying to get the RIGHT most point of the Trapezoid, but I failed to do this. Here's the code so far:
PHP Code:
public void getTopRight() {
topRight_y = y[0];
for (int i = 1; i < y.length; i++) {
if (y[i] > topRight_y) {
topRight_y = y[i];
topRight_x = x[i];
}
}
for (int i = 0; i < x.length; i++) {
if (y[i] == topRight_y && x[i] < topRight_x) {
topRight_x = x[i];
}
}
}
please hlep, anything would help appreciate it!!