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

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

?? geometry.cpp

?? 機器人足球實現的核心代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
// Geometry.cpp: implementation of the Geometry class.
//
//////////////////////////////////////////////////////////////////////

//#include "stdafx.h"
#include "Geometry.h"
#include <stdio.h>    // needed for sprintf


/*! This function returns the sign of a give double.
1 is positive, -1 is negative
\param d1 first parameter
\return the sign of this double */
int sign( double d1 )
{
	return (d1>0)?1:-1;
}

/*! This function returns the maximum of two given doubles.
\param d1 first parameter
\param d2 second parameter
\return the maximum of these two parameters */
/*
double max( double d1, double d2 )
{
return (d1>d2)?d1:d2;
}
*/

/*! This function returns the minimum of two given doubles.
\param d1 first parameter
\param d2 second parameter
\return the minimum of these two parameters */
/*
double min( double d1, double d2 )
{
return (d1<d2)?d1:d2;
}
*/

/*! 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 */
double 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 */
double 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 */
double 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( double 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 double value
\param y a double value
\return the arc tangent of y/x in degrees taking the signs of x and y into
account */
double atan2Deg( double x, double y )
{
	if( fabs( x ) < EPSILON && fabs( y ) < EPSILON )
		return ( 0.0 );
	
	return ( Rad2Deg( atan2( x, y ) ) );
}

/*! 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( double 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( double 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 VecPosition::normalizeAngle(
		atan2Deg( (sinDeg( angMin) + sinDeg( angMax ) )/2.0,
		(cosDeg( angMin) + cosDeg( angMax ) )/2.0 ) );
}

/*****************************************************************************/
/*******************   CLASS VECPOSITION   ***********************************/
/*****************************************************************************/

/*! Constructor for the VecPosition class. When the supplied
Coordinate System type equals CARTESIAN, the arguments x and y
denote the x- and y-coordinates of the new position. When it
equals POLAR however, the arguments x and y denote the polar
coordinates of the new position; in this case x is thus equal to
the distance r from the origin and y is equal to the angle phi
that the polar vector makes with the x-axis.
\param x the x-coordinate of the new position when cs == CARTESIAN; the
distance of the new position from the origin when cs = POLAR
\param y the y-coordinate of the new position when cs = CARTESIAN; the
angle that the polar vector makes with the x-axis when cs = POLAR
\param cs a CoordSystemT indicating whether x and y denote cartesian
coordinates or polar coordinates
\return the VecPosition corresponding to the given arguments */
VecPosition::VecPosition( double x, double y, CoordSystemT cs )
{
	setVecPosition( x, y, cs );
}

/*! Overloaded version of unary minus operator for VecPositions. It returns the
negative VecPosition, i.e. both the x- and y-coordinates are multiplied by
-1. The current VecPosition itself is left unchanged.
\return a negated version of the current VecPosition */
VecPosition VecPosition::operator - ( )
{
	return ( VecPosition( -m_x, -m_y ) );
}

/*! Overloaded version of the binary plus operator for adding a given double
value to a VecPosition. The double value is added to both the x- and
y-coordinates of the current VecPosition. The current VecPosition itself is
left unchanged.
\param d a double value which has to be added to both the x- and
y-coordinates of the current VecPosition
\return the result of adding the given double value to the current
VecPosition */
VecPosition VecPosition::operator + ( const double &d )
{
	return ( VecPosition( m_x + d, m_y + d ) );
}

/*! Overloaded version of the binary plus operator for VecPositions. It returns
the sum of the current VecPosition and the given VecPosition by adding their
x- and y-coordinates. The VecPositions themselves are left unchanged.
\param p a VecPosition
\return the sum of the current VecPosition and the given VecPosition */
VecPosition VecPosition::operator + ( const VecPosition &p )
{
	return ( VecPosition( m_x + p.m_x, m_y + p.m_y ) );
}

/*! Overloaded version of the binary minus operator for subtracting a
given double value from a VecPosition. The double value is
subtracted from both the x- and y-coordinates of the current
VecPosition. The current VecPosition itself is left unchanged.
\param d a double value which has to be subtracted from both the x- and
y-coordinates of the current VecPosition
\return the result of subtracting the given double value from the current
VecPosition */
VecPosition VecPosition::operator - ( const double &d )
{
	return ( VecPosition( m_x - d, m_y - d ) );
}

/*! Overloaded version of the binary minus operator for
VecPositions. It returns the difference between the current
VecPosition and the given VecPosition by subtracting their x- and
y-coordinates. The VecPositions themselves are left unchanged.

  \param p a VecPosition
  \return the difference between the current VecPosition and the given
VecPosition */
VecPosition VecPosition::operator - ( const VecPosition &p )
{
	return ( VecPosition( m_x - p.m_x, m_y - p.m_y ) );
}

/*! Overloaded version of the multiplication operator for multiplying a
VecPosition by a given double value. Both the x- and y-coordinates of the
current VecPosition are multiplied by this value. The current VecPosition
itself is left unchanged.
\param d the multiplication factor
\return the result of multiplying the current VecPosition by the given
double value */
VecPosition VecPosition::operator * ( const double &d  )
{
	return ( VecPosition( m_x * d, m_y * d  ) );
}

/*! Overloaded version of the multiplication operator for
VecPositions. It returns the product of the current VecPosition
and the given VecPosition by multiplying their x- and
y-coordinates. The VecPositions themselves are left unchanged.

  \param p a VecPosition
\return the product of the current VecPosition and the given VecPosition */
VecPosition VecPosition::operator * ( const VecPosition &p )
{
	return ( VecPosition( m_x * p.m_x, m_y * p.m_y ) );
}

/*! Overloaded version of the division operator for dividing a
VecPosition by a given double value. Both the x- and y-coordinates
of the current VecPosition are divided by this value. The current
VecPosition itself is left unchanged.

  \param d the division factor
  \return the result of dividing the current VecPosition by the given double
value */
VecPosition VecPosition::operator / ( const double &d )
{
	return ( VecPosition( m_x / d, m_y / d  ) );
}

/*! Overloaded version of the division operator for VecPositions. It
returns the quotient of the current VecPosition and the given
VecPosition by dividing their x- and y-coordinates. The
VecPositions themselves are left unchanged.

  \param p a VecPosition
\return the quotient of the current VecPosition and the given one */
VecPosition VecPosition::operator / ( const VecPosition &p )
{
	return ( VecPosition( m_x / p.m_x, m_y / p.m_y ) );
}

/*! Overloaded version of the assignment operator for assigning a given double
value to both the x- and y-coordinates of the current VecPosition. This
changes the current VecPosition itself.
\param d a double value which has to be assigned to both the x- and
y-coordinates of the current VecPosition */
void VecPosition::operator = ( const double &d )
{
	m_x = d;
	m_y = d;
}

/*! Overloaded version of the sum-assignment operator for VecPositions. It
returns the sum of the current VecPosition and the given VecPosition by
adding their x- and y-coordinates. This changes the current VecPosition
itself.
\param p a VecPosition which has to be added to the current VecPosition */
void VecPosition::operator +=( const VecPosition &p )
{
	m_x += p.m_x;
	m_y += p.m_y;
}

/*! Overloaded version of the sum-assignment operator for adding a given double
value to a VecPosition. The double value is added to both the x- and
y-coordinates of the current VecPosition. This changes the current
VecPosition itself.
\param d a double value which has to be added to both the x- and
y-coordinates of the current VecPosition */
void VecPosition::operator += ( const double &d )
{
	m_x += d;
	m_y += d;
}

/*! Overloaded version of the difference-assignment operator for
VecPositions.  It returns the difference between the current
VecPosition and the given VecPosition by subtracting their x- and
y-coordinates. This changes the current VecPosition itself.

  \param p a VecPosition which has to be subtracted from the current
VecPosition */
void VecPosition::operator -=( const VecPosition &p )
{
	m_x -= p.m_x;
	m_y -= p.m_y;
}

/*! Overloaded version of the difference-assignment operator for
subtracting a given double value from a VecPosition. The double
value is subtracted from both the x- and y-coordinates of the
current VecPosition. This changes the current VecPosition itself.

  \param d a double value which has to be subtracted from both the x- and
y-coordinates of the current VecPosition */
void VecPosition::operator -=( const double &d )
{
	m_x -= d;
	m_y -= d;
}

/*! Overloaded version of the multiplication-assignment operator for
VecPositions. It returns the product of the current VecPosition
and the given VecPosition by multiplying their x- and
y-coordinates. This changes the current VecPosition itself.

  \param p a VecPosition by which the current VecPosition has to be
multiplied */
void VecPosition::operator *=( const VecPosition &p )
{
	m_x *= p.m_x;
	m_y *= p.m_y;
}

/*! Overloaded version of the multiplication-assignment operator for
multiplying a VecPosition by a given double value. Both the x- and
y-coordinates of the current VecPosition are multiplied by this
value. This changes the current VecPosition itself.

  \param d a double value by which both the x- and y-coordinates of the
current VecPosition have to be multiplied */
void VecPosition::operator *=( const double &d )
{
	m_x *= d;
	m_y *= d;
}

/*! Overloaded version of the division-assignment operator for
VecPositions. It returns the quotient of the current VecPosition
and the given VecPosition by dividing their x- and
y-coordinates. This changes the current VecPosition itself.

\param p a VecPosition by which the current VecPosition is divided */
void VecPosition::operator /=( const VecPosition &p )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区精品性| 另类小说欧美激情| 免费日本视频一区| www.av亚洲| 日韩精品一区二区三区在线| 《视频一区视频二区| 久久不见久久见免费视频1| 欧美性猛片xxxx免费看久爱| 国产精品视频一二| 国产精品一区在线观看乱码| 制服丝袜日韩国产| 一区二区三区在线观看视频| 国产精品资源网站| 欧美大肚乱孕交hd孕妇| 亚洲成年人网站在线观看| 97久久精品人人爽人人爽蜜臀| 亚洲精品在线观| 日韩高清不卡一区二区三区| 日本韩国欧美在线| 国产精品国产三级国产| 国产成人高清在线| 国产色婷婷亚洲99精品小说| 国产精品主播直播| 久久久久国产免费免费| 国产伦精品一区二区三区视频青涩 | 秋霞影院一区二区| 欧美在线不卡视频| 一区二区三区在线视频观看58| 不卡一区二区在线| 亚洲欧洲精品成人久久奇米网| 国产成人在线色| 国产精品久久久久影视| 国产成人免费在线观看| 日本一区二区三区四区在线视频| 国产激情视频一区二区三区欧美 | 色综合久久久久久久久久久| 国产精品二三区| 91在线精品一区二区三区| 国产精品国产a| 91污在线观看| 亚洲成人动漫精品| 欧美一二三四区在线| 美女视频一区二区三区| 久久久久久亚洲综合影院红桃 | 欧美激情一区二区三区全黄| 大白屁股一区二区视频| 亚洲丝袜另类动漫二区| 欧美亚洲禁片免费| 另类小说综合欧美亚洲| 国产日韩在线不卡| 99re热这里只有精品视频| 亚洲免费观看高清完整版在线观看熊| 欧美性做爰猛烈叫床潮| 美国毛片一区二区| 国产精品青草综合久久久久99| aaa国产一区| 日本在线观看不卡视频| 国产婷婷色一区二区三区| 91影院在线观看| 青青草一区二区三区| 欧美高清在线一区| 欧美人与禽zozo性伦| 国产久卡久卡久卡久卡视频精品| 亚洲女爱视频在线| 日韩精品一区二区三区四区 | 色欧美日韩亚洲| 奇米色一区二区三区四区| 国产欧美在线观看一区| 欧美日韩久久久久久| 国产成人在线免费观看| 亚洲成人精品影院| 日本一区二区三区电影| 欧美喷潮久久久xxxxx| 国产成人精品亚洲日本在线桃色| 亚洲永久免费av| 亚洲国产精品传媒在线观看| 欧美日韩电影在线| 国产iv一区二区三区| 免费看精品久久片| 一区二区三区日韩| 26uuu亚洲| 欧美丰满高潮xxxx喷水动漫| 不卡免费追剧大全电视剧网站| 麻豆视频一区二区| 亚洲韩国精品一区| 一色桃子久久精品亚洲| 精品久久国产字幕高潮| 欧美优质美女网站| caoporn国产一区二区| 精品中文字幕一区二区小辣椒| 亚洲一区二区av在线| 国产精品久久一级| 日韩免费观看高清完整版| 欧美日本国产视频| 欧美三区在线观看| 91久久精品一区二区| 91一区二区三区在线播放| 国产99久久久国产精品潘金网站| 久久精品久久综合| 婷婷夜色潮精品综合在线| 一级女性全黄久久生活片免费| 国产精品二区一区二区aⅴ污介绍| 精品国产凹凸成av人网站| 日韩一区二区在线观看| 欧美精品久久99久久在免费线| 91国内精品野花午夜精品| 91在线小视频| 91丨国产丨九色丨pron| av激情成人网| 91性感美女视频| 99综合影院在线| 成人av免费在线| 成人av手机在线观看| 91亚洲男人天堂| 91猫先生在线| 欧美在线色视频| 欧美高清视频不卡网| 欧美日韩成人综合在线一区二区 | 日韩区在线观看| 日韩欧美综合在线| 久久综合九色综合97婷婷| 欧美电视剧在线看免费| 久久亚洲精精品中文字幕早川悠里| aaa欧美日韩| 欧洲精品一区二区| 欧美日韩大陆在线| 精品久久久久一区| 国产精品美女久久久久av爽李琼 | 免费观看久久久4p| 国产精品一区二区免费不卡| 精品福利一区二区三区免费视频| 国产伦理精品不卡| 国产一区二区调教| 国产福利电影一区二区三区| 国产乱色国产精品免费视频| 国产高清成人在线| 99久久99久久综合| 91久久精品国产91性色tv| 6080日韩午夜伦伦午夜伦| 久久亚洲二区三区| 亚洲免费观看高清| 秋霞影院一区二区| 成人午夜av电影| 欧美日韩成人一区| 久久精品日韩一区二区三区| 自拍偷拍国产精品| 蜜桃久久久久久| 国产成人免费视频网站| 色播五月激情综合网| 精品电影一区二区三区| 亚洲欧美日韩精品久久久久| 久久只精品国产| 国产亚洲一区字幕| 亚洲综合无码一区二区| 激情文学综合网| 日本丶国产丶欧美色综合| 欧美精品一区二| 亚洲主播在线播放| 成人晚上爱看视频| 日韩一本二本av| 亚洲女人小视频在线观看| 国产麻豆视频精品| 911国产精品| 亚洲麻豆国产自偷在线| 久久成人精品无人区| 91福利在线播放| 久久久久久久久久久久久夜| 天天综合日日夜夜精品| 99久久综合狠狠综合久久| 久久久欧美精品sm网站| 婷婷开心激情综合| 日本高清视频一区二区| 国产精品免费av| 国产一区二区三区免费在线观看| 欧美乱熟臀69xxxxxx| 一区二区三区资源| 成人av在线一区二区三区| 久久婷婷国产综合国色天香| 日本网站在线观看一区二区三区 | 日本中文字幕一区二区有限公司| 91一区在线观看| 国产精品色哟哟网站| 日本一不卡视频| 欧美日韩高清在线| 亚洲高清在线精品| 欧美在线视频不卡| 一区二区免费在线| 色哟哟在线观看一区二区三区| 欧美国产视频在线| 成人综合婷婷国产精品久久蜜臀| 精品免费国产一区二区三区四区| 亚洲成人激情av| 欧美日韩亚洲综合在线 | 欧美日韩精品一区二区三区| 亚洲丝袜美腿综合| 91看片淫黄大片一级在线观看| 国产精品家庭影院| 色偷偷久久人人79超碰人人澡| 亚洲欧美乱综合| 在线观看国产一区二区|