亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vec2.java

?? 一個多機器人的仿真平臺
?? JAVA
字號:
/* * Vec2.java */package	EDU.gatech.cc.is.util;import java.io.*;import java.lang.*;/** * A class for manipulating 2d vectors.  Both polar and cartesian components  * are always available.  The fields x, y, t (theta) and r are directly  * available for reading, but you should <B> never </B> set them directly.   * Use setx, sety, sett and setr instead.  This (non OO) approach was chosen  * deliberately for speed reasons; no whining. * <P> * +x is right, +y is up. t is in radians with t=0 in the +x direction and * t = PI in the -r direction, increasing CCW. * <P> * NOTE: Vec2's can have direction without magnitude, i.e. theta has meaning * even if x, y and r == 0. *  * <P> * Copyright (c)2000 Tucker Balch * * @author Tucker Balch * @version $Revision: 1.2 $ */public class Vec2 implements Cloneable, Serializable	{	// default is unit vector heading in +x (left)	/**	 * The x component of the cartesian view of the vector; <B>never</B>	 * set directly, use setx instead.	 * @see Vec2#setx	 */	public	double	x=1;	/**	 * The y component of the cartesian view of the vector; <B>never</B>	 * set directly, use sety instead.	 * @see Vec2#sety	 */	public	double	y=0;	/**	 * The theta component of the polar view of the vector; <B>never</B>	 * set directly, use sett instead.	 * @see Vec2#sett	 */	public	double	t=0;	/**	 * The r component of the polar view of the vector; <B>never</B>	 * set directly, use setr instead.	 * @see Vec2#setr	 */	public	double	r=1;	// Since we use them so much	public 	static final	double	PI2	= 2.0 * Math.PI;	public	static final	double	PI	= Math.PI;	/**	 *Create a new vector, (1,0).	 */	public 	Vec2()		{		x = 1;		y = 0;		t = 0;		r = 1;		}			/**	 * Create a new vector, (x0,y0).	 * @param x0 the x component.	 * @param y0 the y component.	 */	public 	Vec2(double x0, double y0)		{		x = x0;		y = y0;		t = Math.atan2(y,x);		r = Math.sqrt(x*x + y*y);		}			/**	 * Create a new vector by copying the input parameter.	 * @param v Vec2, the vector to copy.	 */	public 	Vec2(Vec2 v)		{		x = v.x;		y = v.y;		t = v.t;		r = v.r;		}			/**	 * Create a new vector by cloning.	 * @param v Vec2, the vector to copy.	 */	public 	Object clone()		{		return(new Vec2(this));		}			/**	 * Set the x component. t and r are reset as well.	 * @param newx the x component.	 */	public	void	setx(double newx)		{		x = newx;		r = Math.sqrt(x*x + y*y);		if (r > 0.0)			t = Math.atan2(y,x);		}		/**	 * Set the y component. t and r are reset as well.	 * @param newy the x component.	 */	public	void	sety(double newy)		{		y = newy;		r = Math.sqrt(x*x + y*y);		if (r > 0.0)			t = Math.atan2(y,x);		}		/**	 * Set t. x and y are reset as well.	 * @param newt the t component.	 */	public	void	sett(double newt)		{		t = newt;		while (t > PI2) t = t - PI2;		while (t < 0)   t = t + PI2;		y = r*Math.sin(t);		x = r*Math.cos(t);		}		/**	 * Set r. x, y and t may be reset as well.	 * @param newr the r component.	 */	public	void	setr(double newr)		{                r = newr;                y = r*Math.sin(t);                x = r*Math.cos(t);                if (r < 0)                        {			t = Units.ClipRad(t + Math.PI);                        r = r*-1;                        }		}				/**	 * Rotate the vector. x, y and t are reset.	 * @param rot how many radians to rotate, CCW is positive.	 */	public void	rotate(double rot)		{		sett(t + rot);		}	/**	 * Subtract other vector from self, this = this - other	 * @param other the vector to subtract.	 */	public void	sub(Vec2 other)		{		x = x - other.x;		y = y - other.y;		r = Math.sqrt(x*x + y*y);		if (r > 0)			t = Math.atan2(y,x);		}	/**	 * Same as setr.  Kept for comatibility.	 * @param newr the r component.	 */	public void	normalize(double newr)		{		setr(newr);		}	/**	 * Add another vector to self, this = this + other	 * @param other the vector to add.	 */	public void	add(Vec2 other)		{		x = x + other.x;		y = y + other.y;		r = Math.sqrt(x*x + y*y);		if (r > 0)			t = Math.atan2(y,x);		}	/** 	 * Provides info on which octant (0-7) the vector lies in.	 * 0 indicates 0 radians +- PI/8 1-7 continue CCW.	 * @return 0 - 7, depending on which direction the vector is pointing.  	 */	public int	octant()		{		double	temp = t + Math.PI/8;		if (temp<0) temp += Math.PI*2;		return ((int)(temp/(Math.PI/4))%8);		}	/** 	 * Provides info on which quadrant (0-3) the vector lies in.	 * 0 indicates 0 radians +- PI/4 1-3 continue CCW.	 * @return 0 - 3, depending on which direction the vector is pointing.  	 */	public int	quadrant()		{		double	temp = t + Math.PI/4;		if (temp<0) temp += Math.PI*2;		return ((int)(temp/(Math.PI/2))%4);		}	/**	 * Generate a string value for the vector.	 * @return "(x,y) (r,t)"	 */	public String	toString()		{		return ("(" + x + "," + y + ") (" + r + "," + t + ")");		}	/**	 * A test routine.	 */	public static void main(String[] args)		{		Vec2 temp1 = new Vec2();		Vec2 temp2 = new Vec2();		System.out.println("Initial vector  "+temp1);		temp1.add(temp2);		System.out.println("Doubled         "+temp1);		temp1.rotate(Math.PI/2);		System.out.println("Rotated +90 deg "+temp1);		temp1.rotate(Math.PI/2);		System.out.println("Rotated +90 deg "+temp1);		temp1.sub(temp2);		System.out.println("Subtract 1,0    "+temp1);		temp1.setx(0.0);		System.out.println("Setx to  0      "+temp1);		temp1.setr(2.0);		System.out.println("Setr to  2.0    "+temp1);		temp1.sett(Math.PI);		System.out.println("Sett to  PI     "+temp1);		temp1.setr(0);		System.out.println("Setr to  0      "+temp1);		temp1.setr(1);		System.out.println("Setr to  1      "+temp1);		temp1.setx(0);		System.out.println("Setx to  0      "+temp1);		temp1.sety(0);		System.out.println("Sety to  0      "+temp1);		temp1.setr(1);		temp1.sett(0);		for(int i=0; i<16; i++)			{			System.out.println("t ="+temp1.t+" quad ="+				temp1.quadrant()+" octant="+temp1.octant());			temp1.sett(temp1.t + Math.PI/8);			}		}			}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产毛片精品视频| 欧美性大战久久久久久久蜜臀 | 国产亚洲一区二区三区在线观看| 中文字幕不卡在线| 舔着乳尖日韩一区| 成人国产电影网| 欧美α欧美αv大片| 亚洲综合免费观看高清完整版在线 | 久久免费精品国产久精品久久久久| 亚洲欧洲日韩一区二区三区| 婷婷综合久久一区二区三区| 99精品在线观看视频| 欧美va亚洲va国产综合| 亚洲伊人伊色伊影伊综合网| 大桥未久av一区二区三区中文| 欧美一区二区免费| 亚洲一区二区三区免费视频| 成人久久18免费网站麻豆| 日韩天堂在线观看| 亚洲国产精品影院| 91首页免费视频| 成人欧美一区二区三区黑人麻豆| 成人高清视频免费观看| 欧美成人一区二区| 免费av网站大全久久| 欧美日韩一级片网站| 亚洲综合一二区| 欧洲一区在线观看| 一区二区三区欧美在线观看| 91亚洲精品久久久蜜桃| 17c精品麻豆一区二区免费| 国产成人超碰人人澡人人澡| 久久精品人人爽人人爽| 国产成人午夜精品影院观看视频| 2欧美一区二区三区在线观看视频| 日韩精品1区2区3区| 91精品国产高清一区二区三区蜜臀| 亚洲成人精品在线观看| 欧美精三区欧美精三区| 五月激情丁香一区二区三区| 欧美日韩一区成人| 玖玖九九国产精品| 欧美mv日韩mv国产| 国产风韵犹存在线视精品| 国产日韩欧美综合一区| 成人网在线免费视频| 亚洲精品免费视频| 欧美日韩综合在线| 蜜臀av性久久久久av蜜臀妖精| 日韩精品一区二区三区在线观看 | 亚洲一区二区精品久久av| 91丨porny丨蝌蚪视频| 亚洲一区日韩精品中文字幕| 欧美日韩中文精品| 狠狠色丁香婷综合久久| 国产欧美日韩视频在线观看| 91免费在线播放| 免费人成在线不卡| 亚洲国产精品传媒在线观看| 色天天综合久久久久综合片| 视频一区视频二区中文字幕| 国产亚洲人成网站| 日本韩国精品在线| 蜜桃视频第一区免费观看| 国产精品美女久久久久久久| 在线观看亚洲精品视频| 免费三级欧美电影| 国产精品国产三级国产a| 欧美色爱综合网| 国产综合久久久久久鬼色 | 91麻豆精东视频| 亚洲成年人影院| 欧美韩国一区二区| 欧美日韩高清一区二区不卡| 国产精品一二三四区| 亚洲激情校园春色| 久久久精品免费网站| 久久精品欧美一区二区三区不卡| 99久久久国产精品免费蜜臀| 日韩电影一二三区| ...av二区三区久久精品| 欧美成人a∨高清免费观看| 一本大道久久a久久综合婷婷| 久久精品二区亚洲w码| 日韩一区在线看| 久久伊人中文字幕| 欧美久久一二区| 91网站最新网址| 国产成人精品在线看| 五月婷婷久久综合| 亚洲免费观看高清完整版在线 | 国产精品成人在线观看| 欧美一级理论片| 色一情一乱一乱一91av| 国产精品一区二区久久不卡| 日韩av不卡一区二区| 亚洲美女在线一区| 国产精品全国免费观看高清| 欧美一区二区三区色| 91福利精品第一导航| av中文字幕一区| 国产精品一区二区久激情瑜伽 | 亚洲国产日日夜夜| 亚洲女与黑人做爰| 亚洲人精品午夜| 亚洲欧美在线视频观看| 国产欧美一区视频| 国产午夜亚洲精品午夜鲁丝片| 欧美一区二区大片| 日韩小视频在线观看专区| 欧美精品一二三区| 制服丝袜亚洲色图| 欧美一区二区三区精品| 欧美日韩精品免费观看视频| 欧美视频在线观看一区| 欧美在线视频全部完| 精品视频在线免费看| 欧美日韩高清一区二区不卡| 欧美日韩夫妻久久| 在线不卡的av| 欧美一级精品大片| 欧美刺激脚交jootjob| 久久久久久99精品| 国产婷婷色一区二区三区四区| 久久品道一品道久久精品| 国产欧美日韩不卡免费| 国产精品护士白丝一区av| 国产精品久久久久久户外露出| 成人欧美一区二区三区白人| 亚洲与欧洲av电影| 日韩中文字幕区一区有砖一区| 日本不卡高清视频| 国产一区二区三区在线观看免费视频 | 成人免费av资源| 99久久精品免费看| 欧美吻胸吃奶大尺度电影| 欧美丰满一区二区免费视频| 欧美精品日韩一区| 精品日本一线二线三线不卡| 久久你懂得1024| 亚洲免费av高清| 午夜电影网一区| 国产美女视频一区| 91浏览器在线视频| 欧美日韩一区二区三区免费看| 精品入口麻豆88视频| 国产精品超碰97尤物18| 亚洲一区二区三区自拍| 国产一区二区精品久久| 97久久精品人人做人人爽| 欧美女孩性生活视频| 久久综合九色综合久久久精品综合| **欧美大码日韩| 日本91福利区| 99在线精品观看| 一区二区三区在线不卡| 精品在线一区二区三区| 色综合久久久久久久久久久| 欧美一区二区三区播放老司机| 国产精品久久久久久久久晋中 | 蜜桃精品视频在线| 成年人网站91| 91麻豆精品91久久久久同性| 国产精品九色蝌蚪自拍| 琪琪一区二区三区| 91色九色蝌蚪| 久久精品人人做| 免费日本视频一区| 在线亚洲免费视频| 中文字幕不卡在线观看| 麻豆成人久久精品二区三区小说| 色综合中文字幕国产| xfplay精品久久| 亚洲va韩国va欧美va| av电影在线不卡| 精品免费日韩av| 天天综合色天天| 色综合中文字幕| 国产精品高潮久久久久无| 国内精品免费**视频| 欧美美女bb生活片| 亚洲精品一二三区| 成人免费三级在线| 国产欧美日韩久久| 精品一区二区三区视频| 欧美人xxxx| 一级做a爱片久久| 91麻豆成人久久精品二区三区| 国产丝袜美腿一区二区三区| 久久99精品国产91久久来源 | 欧洲av在线精品| 亚洲同性同志一二三专区| 国产精品亚洲一区二区三区妖精| 日韩一级免费观看| 亚洲成av人片在线观看无码| 91麻豆成人久久精品二区三区| 免费av成人在线| 欧美剧情片在线观看| 性欧美大战久久久久久久久| 在线免费观看日本欧美|