67,513
社区成员
发帖
与我相关
我的任务
分享
public void testPoint() {
float x1 = -176.3501f;
float x2 = -115.5118f;
float y1 = -52.60973f;
float y2 = -52.9807f;
int step = 2;
int x = ((int) (x2 - x1)) / step + ((int) (x2 - x1)) < 1 ? 0 : 1;
System.out.println(x);
int y = ((int) (y2 - y1)) / step + ((int) (y2 - y1)) < 1 ? 0 : 1;
System.out.println(y);
}
for( int i=0; i<x; i++){
Systemp.out.print("["+ (x1+i*step) +"," + y1 +"]")
)
if ((x2 - x1)==0) {
Systemp.out.print("["+ (x2) +"," + y1 +"]")
}
for( int i=0; i<y; i++){
Systemp.out.print("["+ x2 +"," + (y1+step*i) +"]")
)
if ((y2 - y1)==0) {
Systemp.out.print("["+ x2 +"," + y2 +"]")
}