本文整理汇总了C++中point::getx方法的典型用法代码示例。如果您正苦于以下问题:C++ point::getx方法的具体用法?C++ point::getx怎么用?C++ point::getx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point
的用法示例。
在下文中一共展示了point::getx方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calctempdist
float point::calctempdist(point p) {
float dist = ((p.getx()) - (this->x) )*( (p.getx()) - (this->x)) ;
dist += (p.gety()-(this->y))*(p.gety()-(this->y));
dist += (p.gett()-(this->t))*(p.gett()-(this->t));
dist= sqrt(dist);
return dist;
}
示例2: tour
bool tour(int board[8][8],point posNew,int step){
int x = posNew.getx();
int y = posNew.gety();
if (step==64) {
return true;
}
bool result;
for (int k=0; k<8; k++) {
point p = move(x,y,k+1);
int x1,y1;
x1 = p.getx();
y1 = p.gety();
if (x1<8 && x1>=0 && y1<8 && y1>=0 && board[x1][y1]==-1) {
board[x1][y1] = step;
result = tour(board, p, step+1);
if (result) {
return true;
}else{
board[x1][y1]=-1;
}
}
}
return false;
}
示例3: mouseToObj
// Convert mouse coordinates + depth to world coordinates
point mouseToObj(point xyd)
{
int mx = xyd.getx();
int my = xyd.gety();
double depth = xyd.getz();
float clipx = 2.0*mx/win_width - 1;
float clipy = 2.0*(win_height - my)/win_height - 1;
glm::vec4 clip1 = projection*viewT*glm::vec4(0, 0, depth, 1);
glm::vec4 clip(clipx, clipy, clip1.z/clip1.w, 1);
glm::vec4 world = glm::inverse(projection*viewT*viewR)*clip;
return point(world.x/world.w, world.y/world.w, world.z/world.w);
}
示例4:
//************************************
// Method: writeSomethingAt- writes a string to the screen at the requested place.
// FullName: UIs::UI::writeSomethingAt
// Access: protected
// Returns: void
// Qualifier: const
// Parameter: const char* str - text to write.
// Parameter: const point& place - the point at which to write.
//************************************
void UIs::UI::writeSomethingAt(const char * str,const point & place )
{
gotoxy(place.getx(),place.gety());
cout<<str;
}
示例5: point
point operator+(point& p1, point& p2){
point sum = point(p1.getx()+p2.getx(),p1.gety()+p2.gety());
return sum;
}
示例6: calcdist
float point::calcdist(point p) {
float dist = ( ((p.getx()) - (this->x) )*( (p.getx()) - (this->x)) ) + ( (p.gety()-(this->y))*(p.gety()-(this->y)) );
dist= sqrt(dist);
return dist;
}