doublerectangle.java

来自「利用JAVA编写的群体机器人局部通讯完成一定得队形控制」· Java 代码 · 共 35 行

JAVA
35
字号
package EDU.cmu.cs.coral.localize;public class DoubleRectangle {    public double x;    public double y;    public double width;    public double height;    /*x,y is top left corner*/    public DoubleRectangle(double xx, double yy, double ww, double hh) {	x = xx;	y = xx;	width = ww;	height = hh;    }    /* note this assumes the rect is in space iwth origin in the middle*/    public boolean contains(double xx, double yy) {	if ( xx < x || xx > (x+width)) {	    return false;	}	if (yy > y || yy < (y-height)) {	    return false;	}	return true;    }        public String toString() {	return new String("("+x+", "+y+") w = "+width+" h = "+height);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?