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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? angle.java

?? 用Java開發(fā)的、實(shí)現(xiàn)類似Visio功能的應(yīng)用程序源碼
?? JAVA
字號(hào):
/**
 *    $Id:Angle.java $
 *
 *    Copyright 2004 ~ 2005  JingFei International Cooperation LTD. All rights reserved. *
 */
package com.jfimagine.jfgraph.geom;

 
 /**
 * Angle class.  A class used to encapsulate angle processes.
 *
 * @author     CookieMaker    
 *
 * @version $Revision: 1.00 $
 */  
 public class Angle{


  /**
   *   PI for the angle of  180 degrees.
   */
   public static final double  PI			=3.1415926;
 
   /**
    *   An angle from 0 to 2*PI.
    */
   private	double	m_angle	=0;
 

   /**
    *   Get the value of angle.
    *
    *   @return  The angle value.
    *
    */ 	
   public double getAngle(){
   	return m_angle;
   }

   /**
    *   Set angle value.
    *   We should force an angle between 0 ~ 2*PI here.   
    *
    *   @param val  A new rotate angle.
    *
    */ 	
   public void setAngle(double val){
   	m_angle	=getValidAngle(val);
   }


   /**
    *   Set angle value.
    *   We should force an angle between 0 ~ 2*PI here.   
    *
    *   @param val  A new rotate angle.
    *   @return a new angle between 0 ~ 2PI
    *
    */ 	
   public static double getValidAngle(double val){
   	while (val<0)
   		val	+=2 * PI;
   		
   	while (val>= 2 * PI)
   		val	-=2 * PI;
   	
   	return val;
   }


   /**
    *   Get the angle between the line from base point to target point1
    *   and the line from base point to target point2
    *
    *   @param basePoint  A base point.
    *   @param targetPoint1  The target point1.
    *   @param targetPoint2  The target point2.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(JFPoint basePoint, JFPoint targetPoint1, JFPoint targetPoint2){	
   	return getAngle(basePoint,targetPoint1,targetPoint2,false);
   }

   /**
    *   Get the angle between the line from base point to target point1
    *   and the line from base point to target point2
    *
    *   @param basePoint  A base point.
    *   @param targetPoint1  The target point1.
    *   @param targetPoint2  The target point2.
    *   @param hasDirection  Indicate that if this angle will follow the direction that targetPoint2 is under 
    *           clockwise side of targetPoint1 according to basePoint, if so, the angle is a plus value, otherwise negative.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(JFPoint basePoint, JFPoint targetPoint1, JFPoint targetPoint2, boolean hasDirection){	
   	if (basePoint==null || targetPoint1==null || targetPoint2==null)
   		return 0;
   	else{
   		return getAngle(basePoint.getX(),basePoint.getY(),
   			        targetPoint1.getX(),targetPoint1.getY(),
   			        targetPoint2.getX(), targetPoint2.getY(),hasDirection);
   	}
   }


   /**
    *   Get the angle between the line from base point to target point1
    *   and the line from base point to target point2
    *
    *   @param basePointX,&nbsp;basePointY  A base point.
    *   @param targetPoint1X,&nbsp;targetPoint1Y  The target point1.
    *   @param targetPoint2X,&nbsp;targetPoint2Y  The target point2.
    *   @return The angle, this angle will always less or equal than PI.
    *
    */ 	
   public static double getAngle(double basePointX, double basePointY, double targetPoint1X, double targetPoint1Y, double targetPoint2X, double targetPoint2Y){	
   	return getAngle(basePointX,basePointY,targetPoint1X,targetPoint1Y,targetPoint2X,targetPoint2Y,false);
   }

   /**
    *   Get the angle between the line from base point to target point1
    *   and the line from base point to target point2
    *
    *   @param basePointX,&nbsp;basePointY  A base point.
    *   @param targetPoint1X,&nbsp;targetPoint1Y  The target point1.
    *   @param targetPoint2X,&nbsp;targetPoint2Y  The target point2.
    *   @param hasDirection  Indicate that if this angle will follow the direction that targetPoint2 is under 
    *           clockwise side of targetPoint1 according to basePoint, if so, the angle is a plus value, otherwise negative.
    *   @return The angle, Math.abs(this angle) will always less or equal than PI.
    *
    */ 	
   public static double getAngle(double basePointX, double basePointY, double targetPoint1X, double targetPoint1Y, double targetPoint2X, double targetPoint2Y, boolean hasDirection){	
   	double angle1	=getAngle(basePointX, basePointY,targetPoint1X,targetPoint1Y);
   	double angle2	=getAngle(basePointX, basePointY,targetPoint2X,targetPoint2Y);
   	double result	=Math.abs(angle2-angle1);
  	if (result>PI)
   		result  =2 * PI - result;
   	if (!JFVector.underClockwiseSide(targetPoint2X,targetPoint2Y,basePointX,basePointY,
   				         targetPoint1X,targetPoint1Y,basePointX,basePointY)){
   		result	=-result;		        
         }
   		
   	return result;
   }


   /**
    *   Get the angle between the line from base point to target point
    *   and the horizontal line(from left to right).
    *
    *   @param basePoint  A base point.
    *   @param targetPoint  The target point.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(JFPoint basePoint, JFPoint targetPoint){	
   	return getAngle(basePoint,targetPoint,true);
   }

   /**
    *   Get the angle between the line from base point to target point
    *   and the horizontal line(from left to right).
    *
    *   @param baseX,&nbsp;baseY  Coordinates of the base point.
    *   @param targetX,&nbsp;targetY Coordinates of the target point.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(double baseX, double baseY,double targetX,double targetY){	
	return getAngle(baseX,baseY,targetX,targetY,true);   	
   }

   /**
    *   Get the angle between the line from base point to target point
    *   and the horizontal line(from left to right).
    *
    *   @param basePoint  A base point.
    *   @param targetPoint  The target point.
    *   @param counterClockwiseAngle We treat the return angle is under a counter-clockwise quadrant system.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(JFPoint basePoint, JFPoint targetPoint, boolean counterClockwiseAngle){	
   	return getAngle(basePoint.getX(),basePoint.getY(),targetPoint.getX(),targetPoint.getY(),counterClockwiseAngle);
   }
   	

   /**
    *   Get the angle between the line from base point to target point
    *   and the horizontal line(from left to right).
    *
    *   @param baseX,&nbsp;baseY  Coordinates of the base point.
    *   @param targetX,&nbsp;targetY Coordinates of the target point.
    *   @param counterClockwiseAngle We treat the return angle is under a counter-clockwise quadrant system.
    *   @return The angle.
    *
    */ 	
   public static double getAngle(double baseX, double baseY,double targetX,double targetY, boolean counterClockwiseAngle){	

   	double angle=0;
	if (baseX==targetX && baseY==targetY)
		return 0;
	   	
   	//vertical line from basePoint to targetPoint
   	if ((float)baseX==(float)targetX){
   		if (counterClockwiseAngle){
   			if (baseY>targetY)
   				angle	=  PI/2;
   			else
   				angle	=  -1 * PI/2;
   		}else{
   			if (baseY<=targetY)
   				angle	=  PI/2;
   			else
   				angle	=  -1 * PI/2;
   		}
   	
   	//horizontal line from basePoint to targetPoint
   	}else if ((float)baseY==(float)targetY){
   		if (baseX>targetX)
   			angle	=PI;
   		else
   			angle	=0;
   	}else{

   		double slope	=(targetY-baseY)/(targetX-baseX);

   		angle		=Math.atan(slope);

		if (counterClockwiseAngle){	
   			//for a counter clockwise quadrant system, we will adjust the angle to an  ACTUAL slople in a counter-clockwise quadrant system.
   			if (slope>0){
   				//the angle will always under the first/third quadrant.
   				if (targetX < baseX){
   					angle	= Angle.PI - angle;
   				}else{
   					angle	= -1 * angle;
   				}
   			}else{
   				//the angle will always under the second/fourth quadrant.
   				if (targetX < baseX){
   					angle	= Angle. PI + (Angle.PI * 2 -angle);
   				}else{
   					angle   = -1 * angle;
   				}
   			}
   		}else{
   			//for a clockwise quadrant system, we will also adjust the angle.
   			if (slope>0){
   				//the angle will always under the first/third quadrant.
   				if (targetX < baseX){
   					angle	= Angle.PI + angle;
   				}else{
   					angle	= angle;
   				}
   			}else{
   				//the angle will always under the second/fourth quadrant.
   				if (targetX < baseX){
   					angle	= Angle. PI - Math.abs(angle);
   				}else{
   					angle   = angle;
   				}
   			}
   		}
   	}


   	return getValidAngle(angle);
   }


   /**
    *   Calculate a new slope after rotating by an angle.
    *
    *   @param slope original slope of a line.
    *
    *   @param angle new radian angle that rotated.
    *
    *   @return A new slope.
    *
    */ 	
   public static double newSlopeByAddingAngle(double slope,double angle){
	double newSlope	=0;
	//force angle to 0 ~ 2PI
	angle	=getValidAngle(angle);
	if ((float)angle==(float)PI/2 ||(float)angle==(float)PI * 3/2){
		newSlope	=GeomConst.LARGE_VALUE;
	}else{
		newSlope	=Math.tan(angle);
	}
	return newSlopeByAddingSlope(slope,newSlope);
   }

   /**
    *   Calculate a new slope by append a new slope that rotated by a new angle.
    *
    *   @param slope original slope of a line.
    *
    *   @param newSlope a new slope appended.
    *
    *   @return A new slope.
    *
    */ 	
   public static double newSlopeByAddingSlope(double slope,double newSlope){
   	
   	if (slope==0){
   		return newSlope;

   	}else if (slope==GeomConst.LARGE_VALUE){
   		if (newSlope==0)
   			return GeomConst.LARGE_VALUE;
   		
   		else if (newSlope==GeomConst.LARGE_VALUE)	
   			return 0;
   		
   		else
   			return 	-1/newSlope;
   	
   	}else if (newSlope==0){
   		return slope;
   	

   	}else if (newSlope==GeomConst.LARGE_VALUE){
   		return -1/slope;	

	}else{
		if ((float)slope==(float)1/newSlope)
			return GeomConst.LARGE_VALUE;
		else
   			//tan(alpha+beta)=(tan(alpha)+tan(beta))/(1-tan(alpha)*tan(beta))
   			return (slope+newSlope)/(1-slope*newSlope);
   	}
   }


   	  	
   /**
    *   Add a new angle value to existance angle.
    *
    *   @param angle A new angle value to be added.
    *
    */ 	
   public void addAngle(double angle){
   	setAngle(m_angle + angle);
   }


   /**
    *   Constructor for Angle.
    *   Default to 0 for x and y coordinates.
    *
    */ 	
   public Angle(){
   	m_angle	=0;
   }

   /**
    *   Constructor for Angle.
    *   
    *   @param rect A rectangle object.
    *
    */ 	
   public Angle(Angle angle){
   	if (angle!=null){
   		m_angle	=angle.getAngle();
   	}
   }


}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品男人的天堂| 极品少妇一区二区三区精品视频 | 日本一区二区不卡视频| 日韩免费性生活视频播放| 欧美一区二区三区视频| 欧美日本乱大交xxxxx| 欧美日韩在线播放三区| 欧美男女性生活在线直播观看| 在线观看亚洲精品| 欧美在线免费观看亚洲| 欧美日韩在线不卡| 欧美一区二区在线免费观看| 欧美一级搡bbbb搡bbbb| 日韩精品一区二区三区中文不卡 | 欧美制服丝袜第一页| 欧美色爱综合网| 欧美高清视频www夜色资源网| 欧美日韩精品免费| 日韩精品一区二区三区视频播放| 精品国产第一区二区三区观看体验| 久久无码av三级| 国产精品蜜臀在线观看| 亚洲欧美电影一区二区| 亚洲午夜激情av| 日韩影院在线观看| 久久99久久99小草精品免视看| 国产一区二区三区香蕉| 成人午夜免费视频| 色综合激情久久| 678五月天丁香亚洲综合网| 欧美va亚洲va| 国产精品久久久久久妇女6080| 亚洲欧美日韩在线不卡| 日韩**一区毛片| 国产成人精品午夜视频免费| 91啪在线观看| 日韩一级免费一区| 亚洲欧洲日产国产综合网| 亚洲综合色婷婷| 精品一区二区免费在线观看| 99久久精品免费看国产 | 亚洲欧美激情在线| 蜜臀a∨国产成人精品| 国产v综合v亚洲欧| 欧美日本国产视频| 久久精品视频一区| 亚洲在线视频一区| 激情久久五月天| 色婷婷综合视频在线观看| 91精品国产麻豆| 中文字幕亚洲视频| 免费高清不卡av| 99久久久精品免费观看国产蜜| 51午夜精品国产| 国产精品传媒在线| 美女任你摸久久 | 最新日韩在线视频| 琪琪一区二区三区| 91久久人澡人人添人人爽欧美 | 日韩av网站免费在线| 成人av片在线观看| 亚洲精品一区二区三区在线观看| 一区二区三区在线观看动漫 | 9191成人精品久久| 国产精品传媒入口麻豆| 久久精品国产澳门| 欧美日韩三级一区| 亚洲欧美自拍偷拍色图| 韩国精品在线观看| 7777精品久久久大香线蕉| 一区二区三区在线观看国产| 国产福利一区二区三区视频在线| 欧美日韩色一区| 伊人性伊人情综合网| 国产a视频精品免费观看| 欧美一区二区成人| 一区二区不卡在线播放| av电影天堂一区二区在线| www国产成人| 日本特黄久久久高潮| 欧美性生活大片视频| 亚洲丝袜制服诱惑| 高清不卡在线观看av| 久久伊人中文字幕| 久久精品二区亚洲w码| 欧美高清www午色夜在线视频| 一区二区成人在线| 色天使色偷偷av一区二区| ...xxx性欧美| voyeur盗摄精品| 欧美韩日一区二区三区四区| 国产中文一区二区三区| 欧美大片日本大片免费观看| 日本美女一区二区三区| 欧美色图天堂网| 亚洲尤物视频在线| 欧美午夜在线一二页| 亚洲午夜激情网页| 欧美区在线观看| 午夜电影久久久| 91精品国产一区二区三区香蕉| 亚洲国产人成综合网站| 欧美色窝79yyyycom| 亚洲国产wwwccc36天堂| 欧美在线色视频| 香蕉乱码成人久久天堂爱免费| 欧美日韩色一区| 天天做天天摸天天爽国产一区| 在线播放亚洲一区| 日本少妇一区二区| 精品国产一区二区三区忘忧草 | 欧美videofree性高清杂交| 精品午夜久久福利影院 | 国产一区二区三区综合 | 国产91丝袜在线18| 国产日韩精品一区二区三区 | 欧美巨大另类极品videosbest | 91麻豆免费视频| 亚洲已满18点击进入久久| 欧美日韩精品系列| 久久精品99国产精品日本| 精品国偷自产国产一区| 福利电影一区二区| 亚洲欧洲制服丝袜| 欧美一区二区人人喊爽| 国内精品伊人久久久久av一坑| 国产肉丝袜一区二区| 91视频免费播放| 香蕉成人啪国产精品视频综合网| 日韩一区二区免费电影| 国产精品88888| 一区视频在线播放| 欧美男男青年gay1069videost| 久久国产精品一区二区| 国产精品入口麻豆原神| 欧亚洲嫩模精品一区三区| 蜜臀91精品一区二区三区 | 久久99精品国产麻豆不卡| 国产欧美日韩中文久久| 色激情天天射综合网| 日韩精品成人一区二区在线| 久久精品亚洲精品国产欧美| 欧美综合视频在线观看| 精品系列免费在线观看| 亚洲欧美偷拍另类a∨色屁股| 日韩欧美一二三| 色综合久久六月婷婷中文字幕| 日韩高清不卡一区二区三区| 国产亚洲制服色| 欧美日韩色综合| voyeur盗摄精品| 久久99这里只有精品| 亚洲免费观看高清完整版在线观看熊 | 美女视频黄频大全不卡视频在线播放| 欧美国产日韩a欧美在线观看| 欧美亚洲国产bt| 成人影视亚洲图片在线| 三级在线观看一区二区| 国产精品免费观看视频| 欧美大黄免费观看| 欧美在线免费观看视频| 国产69精品一区二区亚洲孕妇| 丝袜美腿一区二区三区| 国产精品毛片久久久久久| 欧美一区二区三区免费观看视频| 91亚洲国产成人精品一区二三 | 日韩女优av电影| 在线观看日韩国产| 国产成a人亚洲精| 久久精品国产一区二区三区免费看| 亚洲色大成网站www久久九九| 精品久久人人做人人爽| 欧美视频在线观看一区| 成人av动漫网站| 国产一区二区美女| 日韩黄色在线观看| 亚洲精品视频在线看| 国产日产欧美一区| 日韩精品最新网址| 欧美丝袜自拍制服另类| 色综合久久久久久久久久久| 国产精品1区2区3区在线观看| 毛片av中文字幕一区二区| 亚洲第一福利视频在线| 中文字幕在线视频一区| 国产午夜三级一区二区三| 精品成人一区二区| 日韩欧美电影一二三| 欧美日精品一区视频| 色综合久久久久综合| 91丨九色porny丨蝌蚪| 成人免费观看av| 国产高清不卡二三区| 国产乱人伦偷精品视频免下载| 美女网站视频久久| 美美哒免费高清在线观看视频一区二区 | 色av成人天堂桃色av| 99精品欧美一区| av影院午夜一区| 成人黄色在线视频|