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

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

?? geometry.cpp

?? 機器人足球AI設計比賽
?? CPP
字號:
/***************************************************************************************** *                                      SEU-3D *                     ------------------------------------------------- * Copyright (c) 2005, Yuan XU<xychn15@yahoo.com.cn>,Chang'e SHI<evelinesce@yahoo.com.cn> * Copyright (c) 2006, Yuan XU<xuyuan.cn@gmail.com>,Chunlu JIANG<JamAceWatermelon@gmail.com> * Southeast University ,China * All rights reserved. * * Additionally,this program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ****************************************************************************************/ #include "Geometry.h"/*! This function converts an angle in radians to the corresponding angle in    degrees.    \param x an angle in radians    \return the corresponding angle in degrees */AngDeg Rad2Deg( AngRad x ){  return ( x * 180 / M_PI );}/*! This function converts an angle in degrees to the corresponding angle in    radians.    \param x an angle in degrees    \return the corresponding angle in radians */AngRad Deg2Rad( AngDeg x ){  return ( x * M_PI / 180 );}/*! This function returns the cosine of a given angle in degrees using the    built-in cosine function that works with angles in radians.    \param x an angle in degrees    \return the cosine of the given angle */float cosDeg( AngDeg x ){  return ( cos( Deg2Rad( x ) ) );}/*! This function returns the sine of a given angle in degrees using the    built-in sine function that works with angles in radians.    \param x an angle in degrees    \return the sine of the given angle */float sinDeg( AngDeg x ){  return ( sin( Deg2Rad( x ) ) );}/*! This function returns the tangent of a given angle in degrees using the    built-in tangent function that works with angles in radians.    \param x an angle in degrees    \return the tangent of the given angle */float tanDeg( AngDeg x ){  return ( tan( Deg2Rad( x ) ) );}/*! This function returns the principal value of the arc tangent of x    in degrees using the built-in arc tangent function which returns    this value in radians.    \param x a double value    \return the arc tangent of the given value in degrees */AngDeg atanDeg( float x ){  return ( Rad2Deg( atan( x ) ) );}/*! This function returns the principal value of the arc tangent of y/x in    degrees using the signs of both arguments to determine the quadrant of the    return value. For this the built-in 'atan2' function is used which returns    this value in radians.    \param x a float value    \param y a float value    \return the arc tangent of *y/x* in degrees taking the signs of x and y into    account */AngDeg atan2Deg( float y, float x ){  if( fabs( y ) < EPSILON && fabs( x ) < EPSILON )    return ( 0.0 );  return ( Rad2Deg( atan2( y, x ) ) );}/*! This function returns the principal value of the arc cosine of x in degrees    using the built-in arc cosine function which returns this value in radians.    \param x a double value    \return the arc cosine of the given value in degrees */AngDeg acosDeg( float x ){  if( x >= 1 )    return ( 0.0 );  else if( x <= -1 )    return ( 180.0 );  return ( Rad2Deg( acos( x ) ) );}/*! This function returns the principal value of the arc sine of x in degrees    using the built-in arc sine function which returns this value in radians.    \param x a double value    \return the arc sine of the given value in degrees */AngDeg asinDeg( float x ){  if( x >= 1 )    return ( 90.0 );  else if ( x <= -1 )    return ( -90.0 );  return ( Rad2Deg( asin( x ) ) );}/*! This function returns a boolean value which indicates whether the value   'ang' (from interval [-180..180] lies in the interval [angMin..angMax].    Examples: isAngInInterval( -100, 4, -150) returns false             isAngInInterval(   45, 4, -150) returns true    \param ang angle that should be checked    \param angMin minimum angle in interval    \param angMax maximum angle in interval    \return boolean indicating whether ang lies in [angMin..angMax] */bool isAngInInterval( AngDeg ang, AngDeg angMin, AngDeg angMax ){  // convert all angles to interval 0..360  if( ( ang    + 360 ) < 360 ) ang    += 360;  if( ( angMin + 360 ) < 360 ) angMin += 360;  if( ( angMax + 360 ) < 360 ) angMax += 360;  if( angMin < angMax ) // 0 ---false-- angMin ---true-----angMax---false--360    return angMin < ang && ang < angMax ;  else                  // 0 ---true--- angMax ---false----angMin---true---360    return !( angMax < ang && ang < angMin );}/*! This method returns the bisector (average) of two angles. It deals    with the boundary problem, thus when 'angMin' equals 170 and 'angMax'    equals -100, -145 is returned.    \param angMin minimum angle [-180,180]    \param angMax maximum angle [-180,180]    \return average of angMin and angMax. */AngDeg getBisectorTwoAngles( AngDeg angMin, AngDeg angMax ){  // separate sine and cosine part to circumvent boundary problem  return normalizeAngle(            atan2Deg( (sinDeg( angMin) + sinDeg( angMax ) )/2.0,                      (cosDeg( angMin) + cosDeg( angMax ) )/2.0 ) );}/*! This method normalizes an angle. This means that the resulting    angle lies between -180 and 180 degrees.    \param angle the angle which must be normalized    \return the result of normalizing the given angle */AngDeg normalizeAngle( AngDeg angle ){  while( angle > 180.0  ) angle -= 360.0;  while( angle < -180.0 ) angle += 360.0;  return ( angle );}Vector3f getPosRelativeFromVision( VisionSense vision ){	return Vector3f        (         vision.distance * cosDeg(vision.theta) * cosDeg(vision.phi),         vision.distance * sinDeg(vision.theta) * cosDeg(vision.phi),         vision.distance * sinDeg(vision.phi)         );}/*!	calculate polar from relative Vector3f\param posRelative relative pos in formate CARTESIAN(X-Y-Z)\return formate POLAR*/VisionSense getPosVisionFromRelative( const Vector3f &posRelative ){	VisionSense polar;	polar.distance = posRelative.Length();	polar.theta = getVector3fHorizontalAng(posRelative);	polar.phi = asinDeg(posRelative.z()/polar.distance);	return polar;}Vector3f normalizeVector3f(const Vector3f &v, const float maxLength ){	if ( v.Length() > maxLength )		return v.Normalized() * maxLength;	else		return v;}Vector3f normalizeDriveForce( Vector3f driveForce ){	driveForce[2] = 0;	return normalizeVector3f( driveForce, max_drive_force ); }float normalizeKickForce( float kickForce ){	return setMaxNMin( kickForce, max_kick_force, 0.0f );}AngDeg normalizeKickAngle( AngDeg kickAngle ){	kickAngle = normalizeAngle( kickAngle );	return setMaxNMin( kickAngle, min_kick_angle, max_kick_angle );}/*!設置矢量的長度    \param v 原矢量	\param length 新矢量的長度	\return 新矢量*/Vector3f setVector3fLength(Vector3f v,float length){	float l=v.Length();	if ( l < EPSILON ) return Vector3f(length,0,0);	v[0]*=(length/l);	v[1]*=(length/l);	v[2]*=(length/l);	return v;}/*! return the two vector's clip angle	just now only consider in 2D !!!!	\param two vector	\return the clip angle*/AngDeg getClipAng(const Vector3f &v1, const Vector3f &v2){	// just now only consider in 2D !!!!	AngDeg ang1 = getVector3fHorizontalAng(v1);	AngDeg ang2 = getVector3fHorizontalAng(v2);	return normalizeAngle( ang1 - ang2 );}/*! return the 3 points clip angle, the 3 points are:	p0------->p1	 \      \       >p2	\param 3 points	\return the clip angle*/AngDeg getClipAng(const Vector3f &p0, const Vector3f &p1, const Vector3f &p2){	return getClipAng( p1-p0, p2-p0);}/*! return if the 3 points is in one line:	if p1------->p2---------->p3 return true	else return false	\param 3 points	\return if the 3 points is in one line*/bool isThreePointOneLine( Vector3f p1, Vector3f p2, Vector3f p3, AngDeg angThr ){	AngDeg ang1 = getVector3fHorizontalAng( p2 - p1 );	AngDeg ang2 = getVector3fHorizontalAng( p3 - p2 );	return ( abs( normalizeAngle( ang1 - ang2 ) ) < angThr );}/*!得到矢量的水平角度    \param v 要得到水平角度的矢量	\return 水平角度*/AngDeg getVector3fHorizontalAng( Vector3f v ){	return atan2Deg( v.y(), v.x() );}//-* it return the distance of p to line ( l2-l1 )//-- when distance is minus, it means p in the left of the linefloat getDistToLine( Vector3f p, Vector3f l1, Vector3f l2 ){	//-* just now, it calculate in 2D, so let z=0	p[2] = l1[2] = l2[2] = 0;		AngDeg angLine = getVector3fHorizontalAng( l2 - l1 );	AngDeg angP = getVector3fHorizontalAng( p - l1 );	AngDeg angDiff = normalizeAngle( angLine - angP );	float dist_p_l1 = ( p - l1 ).Length();	float dist = dist_p_l1 * sin( Deg2Rad( angDiff ) );	return dist;}/////////////////// some function of time ////////////////////Second Time2Second( const Time &t) { return t*0.01;}Time Second2Time( const Second &t) { return t*100; }Step Time2Step( const Time &t) { return static_cast<Step>(t); }Step Second2Step( const Second &t) { return Time2Step( Second2Time(t)); }Time Step2Time ( const Step &t) { return static_cast<Time>(t); }Second Step2Second( const Step &t) { return Time2Second( Step2Time(t));}/////////////////// Sector Function //////////////////////////bool Sector::isInside(const Vector3f &point){	float dist = pow2(point[0] - _start[0]) + pow2(point[1] - _start[1]);	if(dist > pow2(_radius))		return false;	AngDeg clip = getVector3fHorizontalAng(point - _start);	clip -= getVector3fHorizontalAng(_direction);	if(fabs((float)clip) > _alpha / 2)		return false;	return true;}/** this function convert Vector3f to Vector2f *  just skip z dim * @param[in] pos3 Vector3f * @return pos Vector2f */Vector2f projection(const Vector3f &pos3 ){	return Vector2f(pos3.x(),pos3.y());}/** change 2D point or vector to 3D point or vercotr, *  just set the Z axis value to zero * @param[in] pos2 * @return Vector3f */Vector3f projection(const Vector2f &pos2 ){	return Vector3f(pos2[0],pos2[1],0.0f);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩免费不卡视频一区二区三区| 亚洲日本青草视频在线怡红院| 日本一区二区三区免费乱视频 | 久久精品亚洲麻豆av一区二区| 麻豆精品在线看| 成人做爰69片免费看网站| 欧美视频在线一区二区三区| 国产欧美中文在线| 久久精品99国产国产精| 欧美影片第一页| **欧美大码日韩| 国产乱码精品一品二品| 日韩一区二区三区观看| 一区二区三区中文字幕电影 | 色欲综合视频天天天| 久久久九九九九| 久草这里只有精品视频| 欧美日韩一区二区三区在线看| 中文字幕一区二区三中文字幕| 国产一区二区三区四| 欧美激情在线看| 美女视频一区在线观看| 亚洲成a人v欧美综合天堂下载| 欧美变态凌虐bdsm| 精品少妇一区二区三区日产乱码| 精品国一区二区三区| 国产精品久久久一本精品| 亚洲天天做日日做天天谢日日欢 | www.成人网.com| 在线免费观看成人短视频| 91精品一区二区三区在线观看| 久久综合九色综合97婷婷 | 亚洲成av人片在线观看无码| 免费人成在线不卡| 成人久久久精品乱码一区二区三区| 欧美日本不卡视频| 精品国产a毛片| 国产精品网曝门| 性欧美疯狂xxxxbbbb| 国产精品99久| 欧美日韩在线三级| 国产欧美视频一区二区| 亚洲成人自拍一区| 99精品欧美一区二区三区综合在线| 91精品国产麻豆国产自产在线 | 国产精品影视天天线| 欧美在线短视频| 国产欧美精品区一区二区三区| 亚洲最新视频在线观看| 国产成人在线免费| 91精品中文字幕一区二区三区| 中文字幕在线不卡国产视频| 狠狠狠色丁香婷婷综合久久五月| 欧美中文字幕一区二区三区亚洲| 精品国产免费人成在线观看| 婷婷成人综合网| 欧美天天综合网| 亚洲免费色视频| 99久久伊人久久99| 国产亚洲欧美一级| 免费观看91视频大全| 欧美三级视频在线| 亚洲一区在线播放| 色成人在线视频| 亚洲特级片在线| 成人免费观看视频| 亚洲国产激情av| 成人永久免费视频| 图片区日韩欧美亚洲| 91久久线看在观草草青青| 18欧美亚洲精品| 91丨porny丨在线| 日韩一区欧美小说| 91在线小视频| 亚洲精品久久久久久国产精华液| 一道本成人在线| 亚洲日本青草视频在线怡红院 | 日韩一区二区精品在线观看| 偷拍一区二区三区四区| 欧美日韩一区二区三区高清 | 国产成人亚洲综合a∨婷婷| 久久五月婷婷丁香社区| 国产在线一区二区综合免费视频| 日韩欧美国产午夜精品| 另类欧美日韩国产在线| 精品久久一二三区| 国产aⅴ综合色| ...av二区三区久久精品| 色一情一伦一子一伦一区| 日韩中文字幕区一区有砖一区| 欧美日韩不卡视频| 捆绑调教美女网站视频一区| 精品日韩99亚洲| 成人免费视频一区二区| 自拍av一区二区三区| 欧美日韩一区 二区 三区 久久精品| 天堂va蜜桃一区二区三区漫画版 | 国产精一品亚洲二区在线视频| 久久精品男人的天堂| 色综合天天天天做夜夜夜夜做| 一区二区三区高清在线| 欧美精品视频www在线观看| 老司机免费视频一区二区三区| 国产婷婷一区二区| 在线观看日韩国产| 蜜桃免费网站一区二区三区| 国产精品午夜在线| 欧美日韩成人在线| 国产成人精品免费| 五月天久久比比资源色| 国产精品欧美综合在线| 欧洲精品一区二区三区在线观看| 免费日本视频一区| 亚洲视频在线一区| 久久男人中文字幕资源站| 在线观看中文字幕不卡| 国产麻豆精品久久一二三| 亚洲一区免费视频| 久久精品夜色噜噜亚洲a∨| 在线精品国精品国产尤物884a| 极品少妇一区二区| 亚洲综合色区另类av| 国产欧美日韩精品一区| 欧美一区二区在线视频| 色综合久久综合网欧美综合网 | 蜜桃视频免费观看一区| 亚洲视频电影在线| 国产午夜精品一区二区三区视频| 在线免费不卡电影| www.亚洲精品| 国产寡妇亲子伦一区二区| 午夜一区二区三区视频| 亚洲欧美综合色| 欧美国产在线观看| 久久久亚洲精华液精华液精华液| www精品美女久久久tv| 欧美精品一二三| 在线观看国产精品网站| 成人免费视频视频| 国产在线精品一区二区不卡了| 亚洲成人1区2区| 夜夜揉揉日日人人青青一国产精品| 久久精品一区二区三区av | 国产91对白在线观看九色| 久久精品理论片| 看片的网站亚洲| 毛片av一区二区三区| 日本午夜精品一区二区三区电影| 伊人婷婷欧美激情| 亚洲欧美日韩小说| 亚洲裸体xxx| 一区二区三区自拍| 亚洲国产三级在线| 亚洲国产精品久久人人爱蜜臀| 亚洲精品成a人| 一区二区三区国产精品| 亚洲一区二区三区小说| 亚洲电影在线免费观看| 亚洲第一精品在线| 免费视频最近日韩| 激情亚洲综合在线| 国产成人小视频| 色拍拍在线精品视频8848| 91网址在线看| 欧美视频日韩视频| 欧美大片在线观看| 国产三级一区二区| 国产精品久久久久久久久免费樱桃 | 精品av综合导航| 久久精品视频在线免费观看| 中文天堂在线一区| 一区二区三区精品| 久久99久久精品欧美| 国内外成人在线| www.色精品| 欧美精三区欧美精三区| 日韩欧美激情四射| 国产日韩欧美一区二区三区综合| 亚洲欧美一区二区在线观看| 亚洲一区在线视频观看| 免费精品视频最新在线| 国产.精品.日韩.另类.中文.在线.播放| 成人国产精品免费观看动漫| 欧美日韩精品一区二区天天拍小说| 日韩欧美国产三级电影视频| 国产精品素人一区二区| 亚洲成av人片一区二区| 麻豆视频一区二区| 国产在线国偷精品免费看| 福利电影一区二区三区| 欧美少妇一区二区| 久久综合狠狠综合久久综合88 | 日本大香伊一区二区三区| 26uuu精品一区二区| 亚洲一区二区成人在线观看| 另类综合日韩欧美亚洲| 99视频精品在线| 2024国产精品视频| 亚洲第一电影网| 欧美电影一区二区三区|