1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| package fence;
| import tbDataModel.Yuan_xing;
| public class Juge_in_yuan {
| public static boolean is_in(Yuan_xing yuan_x,int xx,int yy) {
| boolean in=false;
| double x1=xx;
| double y1=yy;
| double x0=yuan_x.getX();
| double y0=yuan_x.getY();
| double r=yuan_x.getR();
| double a2=(x0-x1)*(x0-x1);
| double b2=(y0-y1)*(y0-y1);
| double ab2=a2+b2;
| double R=Math.sqrt(ab2);
| if(r>R) {
| in=true;
| }
| return in;
| }
| }
|
|