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

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

?? geometry.c

?? 機器足球2D比賽程序 對trlen_base_2002的改進
?? C
?? 第 1 頁 / 共 5 頁
字號:
  int    iSol;  double dSol1, dSol2;  double h = circle.getCenter().getX();  double k = circle.getCenter().getY();  // line:   x = -c/b (if a = 0)  // circle: (x-h)^2 + (y-k)^2 = r^2, with h = center.x and k = center.y  // fill in:(-c/b-h)^2 + y^2 -2ky + k^2 - r^2 = 0  //         y^2 -2ky + (-c/b-h)^2 + k^2 - r^2 = 0  // and determine solutions for y using abc-formula  if( fabs(m_a) < EPSILON )  {    iSol = Geometry::abcFormula( 1, -2*k, ((-m_c/m_b) - h)*((-m_c/m_b) - h)              + k*k - circle.getRadius()*circle.getRadius(), &dSol1, &dSol2);    posSolution1->setVecPosition( (-m_c/m_b), dSol1 );    posSolution2->setVecPosition( (-m_c/m_b), dSol2 );    return iSol;  }  // ay + bx + c = 0 => y = -b/a x - c/a, with da = -b/a and db = -c/a  // circle: (x-h)^2 + (y-k)^2 = r^2, with h = center.x and k = center.y  // fill in:x^2 -2hx + h^2 + (da*x-db)^2 -2k(da*x-db) + k^2 - r^2 = 0  //         x^2 -2hx + h^2 + da^2*x^2 + 2da*db*x + db^2 -2k*da*x -2k*db  //                                                         + k^2 - r^2 = 0  //         (1+da^2)*x^2 + 2(da*db-h-k*da)*x + h2 + db^2  -2k*db + k^2 - r^2 = 0  // and determine solutions for x using abc-formula  // fill in x in original line equation to get y coordinate  double da = -m_b/m_a;  double db = -m_c/m_a;  double dA = 1 + da*da;  double dB = 2*( da*db - h - k*da );  double dC = h*h + db*db - 2*k*db + k*k - circle.getRadius()*circle.getRadius();  iSol = Geometry::abcFormula( dA, dB, dC, &dSol1, &dSol2 );  posSolution1->setVecPosition( dSol1, da*dSol1 + db );  posSolution2->setVecPosition( dSol2, da*dSol2 + db );  return iSol;}/*! This method returns the tangent line to a VecPosition. This is the line    between the specified position and the closest point on the line to this    position.    \param pos VecPosition point with which tangent line is calculated.    \return Line line tangent to this position */Line Line::getTangentLine( VecPosition pos ){  // ay + bx + c = 0 -> y = (-b/a)x + (-c/a)  // tangent: y = (a/b)*x + C1 -> by - ax + C2 = 0 => C2 = ax - by  // with pos.y = y, pos.x = x  return Line( m_b, -m_a, m_a*pos.getX() - m_b*pos.getY() );}/*! This method returns the closest point on a line to a given position.    \param pos point to which closest point should be determined    \return VecPosition closest point on line to 'pos'. */VecPosition Line::getPointOnLineClosestTo( VecPosition pos ){  Line l2 = getTangentLine( pos );  // get tangent line  return getIntersection( l2 );     // and intersection between the two lines}/*! This method returns the distance between a specified position and the    closest point on the given line.    \param pos position to which distance should be calculated    \return double indicating the distance to the line. */double Line::getDistanceWithPoint( VecPosition pos ){  return pos.getDistanceTo( getPointOnLineClosestTo( pos ) );}/*! This method determines whether the projection of a point on the current line    lies between two other points ('point1' and 'point2') that lie on the same    line.    \param pos point of which projection is checked.    \param point1 first point on line    \param point2 second point on line    \return true when projection of 'pos' lies between 'point1' and 'point2'.*/bool Line::isInBetween( VecPosition pos, VecPosition point1, VecPosition point2){  pos          = getPointOnLineClosestTo( pos ); // get closest point  double dDist = point1.getDistanceTo( point2 ); // get distance between 2 pos  // if the distance from both points to the projection is smaller than this  // dist, the pos lies in between.  return pos.getDistanceTo( point1 ) <= dDist &&         pos.getDistanceTo( point2 ) <= dDist;}/*! This method calculates the y coordinate given the x coordinate    \param x coordinate    \return y coordinate on this line */double Line::getYGivenX( double x ){ if( m_a == 0 ) {   cerr << "(Line::getYGivenX) Cannot calculate Y coordinate: " ;   show( cerr );   cerr << endl;   return 0; }  // ay + bx + c = 0 ==> ay = -(b*x + c)/a  return -(m_b*x+m_c)/m_a;}/*! This method calculates the x coordinate given the x coordinate    \param y coordinate    \return x coordinate on this line */double Line::getXGivenY( double y ){ if( m_b == 0 ) {   cerr << "(Line::getXGivenY) Cannot calculate X coordinate\n" ;   return 0; }  // ay + bx + c = 0 ==> bx = -(a*y + c)/a  return -(m_a*y+m_c)/m_b;}/*! This method creates a line given two points.    \param pos1 first point    \param pos2 second point    \return line that passes through the two specified points. */Line Line::makeLineFromTwoPoints( VecPosition pos1, VecPosition pos2 ){  // 1*y + bx + c = 0 => y = -bx - c  // with -b the direction coefficient (or slope)  // and c = - y - bx  double dA=1.0, dB, dC;  double dTemp = pos2.getX() - pos1.getX(); // determine the slope  if( fabs(dTemp) < EPSILON )  {    // ay + bx + c = 0 with vertical slope=> a = 0, b = 1    dA = 0.0;    dB = 1.0;  }  else  {    // y = (-b)x -c with -b the slope of the line    dA = 1.0;    dB = -(pos2.getY() - pos1.getY())/dTemp;  }  // ay + bx + c = 0 ==> c = -a*y - b*x  dC =  - dA*pos2.getY()  - dB * pos2.getX();  return Line( dA, dB, dC );}/*! This method creates a line given a position and an angle.    \param vec position through which the line passes    \param angle direction of the line.    \return line that goes through position 'vec' with angle 'angle'. */Line Line::makeLineFromPositionAndAngle( VecPosition vec, AngDeg angle ){  // calculate point somewhat further in direction 'angle' and make  // line from these two points.  return makeLineFromTwoPoints( vec, vec+VecPosition(1,angle,POLAR));}/*! This method returns the a coefficient from the line ay + bx + c = 0.    \return a coefficient of the line. */double Line::getACoefficient() const{  return m_a;}/*! This method returns the b coefficient from the line ay + bx + c = 0.    \return b coefficient of the line. */double Line::getBCoefficient() const{ return m_b;}/*! This method returns the c coefficient from the line ay + bx + c = 0.    \return c coefficient of the line. */double Line::getCCoefficient() const{ return m_c;}/******************************************************************************//********************** CLASS RECTANGLE ***************************************//******************************************************************************//*! This is the constructor of a Rectangle. Two points will be given. The    order does not matter as long as two opposite points are given (left    top and right bottom or right top and left bottom).    \param pos first point that defines corner of rectangle    \param pos2 second point that defines other corner of rectangle    \return rectangle with 'pos' and 'pos2' as opposite corners. */Rectangle::Rectangle( VecPosition pos, VecPosition pos2 ){  setRectanglePoints( pos, pos2 );}/*! This method sets the upper left and right bottom point of the current    rectangle.    \param pos first point that defines corner of rectangle    \param pos2 second point that defines other corner of rectangle */void Rectangle::setRectanglePoints( VecPosition pos1, VecPosition pos2 ){  m_posLeftTop.setX    ( max( pos1.getX(), pos2.getX() ) );  m_posLeftTop.setY    ( min( pos1.getY(), pos2.getY() ) );  m_posRightBottom.setX( min( pos1.getX(), pos2.getX() ) );  m_posRightBottom.setY( max( pos1.getY(), pos2.getY() ) );}/*! This method prints the rectangle to the specified output stream in the    format rect( top_left_point, bottom_right_point ).    \param os output stream to which rectangle is written. */void Rectangle::show( ostream& os ){  cout << "rect(" << m_posLeftTop << " " << m_posRightBottom << ")";}/*! This method determines whether the given position lies inside the current    rectangle.    \param pos position which is checked whether it lies in rectangle    \return true when 'pos' lies in the rectangle, false otherwise */bool Rectangle::isInside( VecPosition pos ){  return pos.isBetweenX( m_posRightBottom.getX(), m_posLeftTop.getX() ) &&         pos.isBetweenY( m_posLeftTop.getY(),     m_posRightBottom.getY() );}/*! This method sets the top left position of the rectangle    \param pos new top left position of the rectangle    \return true when update was successful */bool Rectangle::setPosLeftTop( VecPosition pos ){  m_posLeftTop = pos;  return true;}/*! This method returns the top left position of the rectangle    \return top left position of the rectangle */VecPosition Rectangle::getPosLeftTop( VecPosition pos ){  return m_posLeftTop;}/*! This method sets the right bottom position of the rectangle    \param pos new right bottom position of the rectangle    \return true when update was succesfull */bool Rectangle::setPosRightBottom( VecPosition pos ){  m_posRightBottom = pos;  return true;}/*! This method returns the right bottom position of the rectangle    \return top right bottom of the rectangle */VecPosition Rectangle::getPosRightBottom( VecPosition pos ){  return m_posRightBottom;}/******************************************************************************//********************** TESTING PURPOSES *************************************//******************************************************************************//*#include<iostream.h>int main( void ){  double dFirst = 1.0;  double dRatio = 2.5;  double dSum   = 63.4375;  double dLength = 4.0;  printf( "sum: %f\n", Geometry::getSumGeomSeries( dFirst, dRatio, dLength));  printf( "length: %f\n", Geometry::getLengthGeomSeries( dFirst, dRatio, dSum));}int main( void ){  Line l1(1,-1,3 );  Line l2(1,-0.2,10 ); Line l3 = Line::makeLineFromTwoPoints( VecPosition(1,-1), VecPosition(2,-2) ); l3.show(); cout << endl; l1.show(); l2.show();  l1.getIntersection( l2 ).show();}int main( void ){  Line l( 1, -1, 0 );  VecPosition s1, s2;  int i = l.getCircleIntersectionPoints( Circle( VecPosition(1,1),1) &s1, &s2 );  printf( "number of solutions: %d\n", i );  if( i == 2 )  {    cout << s1 << " " << s2 ;  }  else if( i == 1 )  {    cout << s1;  }  cout << "line: " << l;}int main( void ){  Circle c11( VecPosition( 10, 0 ), 10);  Circle c12( VecPosition( 40, 3 ), 40 );  Circle c21( VecPosition(  0,0 ), 5);  Circle c22( VecPosition(  3,0 ), 40 );  VecPosition p1, p2;  cout << c11.getIntersectionArea( c21 ) << endl;  cout << c12.getIntersectionArea( c21 ) << endl;  cout << c22.getIntersectionArea( c11 ) << endl;  cout << c12.getIntersectionArea( c22 ) << endl;  return 0;}int main( void ){  cout << getBisectorTwoAngles( -155.3, 179.0 ) << endl;  cout << getBisectorTwoAngles( -179.3, 179.0 ) << endl;}*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美在线视频| 一本久道久久综合中文字幕| 欧美日韩亚洲综合一区二区三区| 中文字幕av在线一区二区三区| 国产精品一区不卡| 国产欧美一区二区三区在线老狼| 国产69精品一区二区亚洲孕妇| 欧美国产日本韩| 91麻豆国产精品久久| 亚洲精品va在线观看| 欧洲国产伦久久久久久久| 午夜久久电影网| 精品美女一区二区| 成人黄色av网站在线| 一区二区三区资源| 欧美一区二区三区小说| 美腿丝袜亚洲色图| 欧美国产综合一区二区| 91丨九色丨黑人外教| 亚洲一区二区三区四区在线免费观看 | www久久久久| 大胆欧美人体老妇| 亚洲综合小说图片| 久久综合九色综合欧美98| 成人a级免费电影| 亚洲一区二区成人在线观看| 日韩欧美国产不卡| 91论坛在线播放| 久久激五月天综合精品| 国产精品麻豆视频| 91精品国产欧美日韩| 国产精品一二三区| 亚洲一区二区偷拍精品| 欧美大片拔萝卜| 色噜噜狠狠成人中文综合| 奇米色一区二区三区四区| 国产精品你懂的| 久久新电视剧免费观看| 亚洲欧美日韩在线不卡| 欧美日本一区二区三区| 中文字幕一区av| 国产精品99久久不卡二区| 色综合天天综合网天天狠天天 | 国产综合色精品一区二区三区| 不卡电影一区二区三区| 精品久久一二三区| 爽爽淫人综合网网站| 91精品国产综合久久精品麻豆| 自拍偷拍国产精品| 激情文学综合网| 在线成人免费观看| 亚洲国产精品av| 粉嫩在线一区二区三区视频| 精品日韩在线一区| 91浏览器在线视频| 欧美日韩精品高清| 亚洲精品免费在线观看| 精品精品欲导航| 久久看人人爽人人| 一二三区精品福利视频| 国产乱人伦偷精品视频不卡| 日本精品免费观看高清观看| 国产精品不卡在线| 91麻豆免费看| 亚洲国产日产av| 久久午夜电影网| 99精品视频中文字幕| 亚洲第一激情av| 精品国产区一区| 99这里只有精品| 在线观看亚洲专区| 色综合天天综合在线视频| 国产成人精品aa毛片| 国产最新精品免费| 国产真实乱对白精彩久久| 青青草国产成人av片免费| 天天色天天爱天天射综合| 亚洲一区二区三区四区的| 玉足女爽爽91| 亚洲成年人网站在线观看| 亚洲一区二区三区不卡国产欧美| 亚洲天堂精品在线观看| 中文字幕中文字幕在线一区| 国产精品视频线看| 国产精品久久免费看| 国产精品毛片无遮挡高清| 国产精品久久久久久久岛一牛影视 | 国产aⅴ综合色| 丁香婷婷综合色啪| 成人av在线播放网站| 99久久国产综合精品麻豆| 91亚洲精品久久久蜜桃网站| 99re在线视频这里只有精品| 色综合久久久网| 欧美色男人天堂| 欧美一级欧美三级在线观看| 日韩欧美的一区| 国产日韩欧美一区二区三区综合| 国产视频一区二区在线| 国产精品免费网站在线观看| 亚洲欧美日韩久久| 亚洲成av人**亚洲成av**| 日韩不卡手机在线v区| 国产一区二区三区四区五区美女 | 51精品秘密在线观看| 制服.丝袜.亚洲.另类.中文| 日韩欧美二区三区| 中文文精品字幕一区二区| 中文字幕日韩av资源站| 亚洲va欧美va天堂v国产综合| 看片的网站亚洲| 夫妻av一区二区| 欧美亚洲国产一卡| 日韩欧美区一区二| 亚洲日本成人在线观看| 香蕉av福利精品导航| 国产成人在线视频免费播放| 不卡的电视剧免费网站有什么| 欧美色偷偷大香| 精品国产一区二区在线观看| 亚洲三级在线观看| 久久er99热精品一区二区| 91视频xxxx| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲视频电影在线| 日本不卡的三区四区五区| www.亚洲色图| 日韩欧美国产不卡| 亚洲国产精品久久久久秋霞影院| 国产精品亚洲人在线观看| 欧美丝袜丝nylons| 中文字幕 久热精品 视频在线| 日韩有码一区二区三区| aa级大片欧美| 久久久精品国产免费观看同学| 亚洲高清不卡在线| aaa欧美大片| 久久综合给合久久狠狠狠97色69| 亚洲图片一区二区| 成人国产亚洲欧美成人综合网| 欧美一区二区成人6969| 一区二区三区日本| 成人做爰69片免费看网站| 欧美一区二区三区在线观看视频 | 韩国成人福利片在线播放| 欧美性一二三区| 国产精品福利在线播放| 激情综合五月天| 欧美久久久久久久久久| 一区二区久久久久久| 成人av影院在线| 国产婷婷一区二区| 激情五月婷婷综合网| 日韩午夜在线观看视频| 香蕉影视欧美成人| 欧美日韩国产一级二级| 亚洲六月丁香色婷婷综合久久 | 欧美变态口味重另类| 亚洲不卡在线观看| 欧美性大战久久| 亚洲精品写真福利| 91久久精品一区二区三| 国产精品传媒入口麻豆| 成人黄色777网| 国产精品久久久久久久久久免费看 | 欧美精品精品一区| 亚洲国产精品一区二区www在线 | 色综合久久久久久久| 中文字幕欧美国产| 成人综合婷婷国产精品久久| 欧美精品一区二区高清在线观看| 久久不见久久见免费视频7| 91麻豆精品国产91久久久资源速度| 午夜欧美一区二区三区在线播放| 在线亚洲+欧美+日本专区| 亚洲一区二区三区四区在线免费观看 | 一区二区日韩电影| 在线视频中文字幕一区二区| 夜夜嗨av一区二区三区网页| 在线免费不卡视频| 亚洲va韩国va欧美va精品| 欧美精品一二三| 麻豆精品在线播放| 久久免费美女视频| 不卡影院免费观看| 亚洲永久免费av| 欧美一级生活片| 国产精品乡下勾搭老头1| 国产精品美女一区二区三区| 一本色道综合亚洲| 蜜臀精品久久久久久蜜臀| xnxx国产精品| 99精品欧美一区二区三区小说| 一区二区三区美女视频| 欧美人牲a欧美精品| 国产精品综合在线视频| 中文字幕一区二区三区在线观看| 在线精品国精品国产尤物884a| 日韩国产欧美一区二区三区| 26uuu久久综合|