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

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

?? geometry.cpp

?? 一個C編寫的足球機器人比賽程序
?? 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一区二区三区免费野_久草精品视频
欧美激情资源网| 国产精品视频一区二区三区不卡| 国产精品精品国产色婷婷| 9l国产精品久久久久麻豆| 91.麻豆视频| 中文字幕日本不卡| 国产乱码精品一区二区三区忘忧草| 欧美日韩一区小说| 亚洲人妖av一区二区| 国产综合色视频| 777色狠狠一区二区三区| 亚洲人成人一区二区在线观看| 国产精品一区二区免费不卡| 91精品啪在线观看国产60岁| 夜夜嗨av一区二区三区四季av| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 久久久久国产免费免费| 日本在线不卡视频一二三区| 欧美中文字幕不卡| 亚洲欧美经典视频| av高清不卡在线| 国产日韩一级二级三级| 精品综合久久久久久8888| 91精品啪在线观看国产60岁| 亚洲高清一区二区三区| 欧亚洲嫩模精品一区三区| 亚洲欧美偷拍另类a∨色屁股| 成人av在线播放网站| 国产三级久久久| 国产成人日日夜夜| 国产日韩欧美激情| 国产夫妻精品视频| 久久久高清一区二区三区| 久久国产综合精品| 精品久久久久久亚洲综合网| 青青草伊人久久| 欧美一级一区二区| 麻豆一区二区在线| 精品欧美乱码久久久久久1区2区| 人人精品人人爱| 日韩免费观看2025年上映的电影| 蜜桃视频第一区免费观看| 日韩一区二区影院| 美女一区二区在线观看| 日韩精品一区二区三区三区免费| 久久爱www久久做| 精品91自产拍在线观看一区| 日韩精品成人一区二区在线| 欧美顶级少妇做爰| 欧美a级一区二区| 精品国产伦理网| 国产在线精品一区二区不卡了| 久久伊人中文字幕| 国产成人免费在线观看不卡| 欧美激情一区二区三区四区| av动漫一区二区| 亚洲与欧洲av电影| 欧美精品第一页| 蜜桃一区二区三区在线观看| www精品美女久久久tv| 国v精品久久久网| 国产精品美女久久久久久2018| 99久久精品国产精品久久| 亚洲在线成人精品| 日韩写真欧美这视频| 国产一区二区久久| 亚洲日本在线观看| 精品视频在线视频| 久久av中文字幕片| 国产精品传媒视频| 精品视频在线看| 精品中文字幕一区二区| 国产精品久久久久久久久免费桃花| 在线看国产一区二区| 免费的成人av| 国产精品黄色在线观看| 欧美日韩一区二区在线观看视频| 奇米精品一区二区三区在线观看| 久久精品日韩一区二区三区| 色婷婷综合五月| 久久精品国产在热久久| 中文字幕高清一区| 欧美日韩精品综合在线| 在线一区二区三区| 捆绑调教一区二区三区| 国产精品国产自产拍高清av| 欧美日韩一区高清| 国产99精品视频| 亚洲成av人片在线| 久久久av毛片精品| 在线免费观看日韩欧美| 国产在线日韩欧美| 一区二区三区不卡视频在线观看| 精品日韩在线观看| 在线视频国内自拍亚洲视频| 国内精品视频666| 亚洲一区二区视频| 国产亚洲精品福利| 欧美日韩中文国产| 国产成人亚洲综合色影视| 亚洲国产综合91精品麻豆| 久久综合九色综合97_久久久| 色婷婷久久综合| 国产一区二区三区在线观看免费| 一区二区三区中文在线| 久久精品欧美日韩精品 | 免费久久精品视频| 1000精品久久久久久久久| 精品少妇一区二区三区日产乱码| 94色蜜桃网一区二区三区| 久久精品国产久精国产| 一个色综合av| 亚洲国产高清在线观看视频| 欧美一区二区精品| 日本丰满少妇一区二区三区| 韩国成人精品a∨在线观看| 亚洲香肠在线观看| 亚洲欧洲日韩综合一区二区| 精品国产一区久久| 欧美精品日韩一区| 在线观看一区二区视频| 日韩国产欧美在线视频| 亚洲欧美日韩国产手机在线| 国产天堂亚洲国产碰碰| 欧美成人官网二区| 欧美另类一区二区三区| 91久久国产综合久久| 成人黄色在线看| 国产酒店精品激情| 久久福利资源站| 免费在线观看一区二区三区| 亚洲一区二区不卡免费| 亚洲欧美日韩一区| 国产精品国产三级国产普通话三级| 精品国产污污免费网站入口 | 97久久超碰精品国产| 国产一区二区三区久久悠悠色av| 日韩va亚洲va欧美va久久| 亚洲国产成人精品视频| 亚洲在线中文字幕| 一区二区三区蜜桃| 亚洲欧美电影院| 亚洲三级在线播放| 亚洲欧美色图小说| 亚洲免费成人av| 亚洲精品一二三| 亚洲精品大片www| 一区二区三区视频在线观看| **欧美大码日韩| 亚洲欧洲韩国日本视频| 中文字幕乱码亚洲精品一区| 欧美激情中文字幕| 日韩免费看网站| 欧美一级精品大片| 日韩亚洲欧美成人一区| 欧美一级专区免费大片| 日韩欧美国产三级电影视频| 欧美电影免费观看高清完整版在线观看 | heyzo一本久久综合| va亚洲va日韩不卡在线观看| 99免费精品视频| 色播五月激情综合网| 欧美自拍偷拍午夜视频| 欧美日韩视频不卡| 91精品国产91热久久久做人人 | 色狠狠色狠狠综合| 欧美性猛交一区二区三区精品| 欧美性三三影院| 欧美一级免费观看| 精品国产伦一区二区三区免费| 久久亚洲欧美国产精品乐播| 欧美国产精品劲爆| 综合久久久久久久| 亚洲综合图片区| 人妖欧美一区二区| 国产电影一区二区三区| 成av人片一区二区| 色呦呦日韩精品| 欧美欧美欧美欧美| 精品国产一区二区国模嫣然| 国产亚洲精品福利| 亚洲精品欧美在线| 日韩中文字幕区一区有砖一区 | 一区二区三区视频在线看| 午夜av电影一区| 韩国中文字幕2020精品| thepron国产精品| 精品婷婷伊人一区三区三| 欧美成人a视频| 亚洲国产经典视频| 亚洲国产精品一区二区久久恐怖片| 日本成人在线网站| 成人精品国产一区二区4080| 在线观看日韩av先锋影音电影院| 日韩亚洲国产中文字幕欧美| 中文字幕欧美国产| 亚洲国产另类av| 国产精品资源在线看| 91国产免费观看| 精品少妇一区二区三区在线播放 |