本文整理汇总了C++中Airport::getPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Airport::getPoint方法的具体用法?C++ Airport::getPoint怎么用?C++ Airport::getPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Airport
的用法示例。
在下文中一共展示了Airport::getPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fabs
Route::Route( Airport from, Airport to ) {
this->from = from.getPoint();
this->from_id = from.getId();
this->to = to.getPoint();
this->to_id = to.getId();
this->complete = false;
this->parity = true;
this->current = this->from;
this->via_pacific = false;
this->lon_range = fabs( this->from.y - this->to.y );
this->sign = ( ( this->from.y - this->to.y ) > 0 ) ? -1 : 1;
this->step_lon = 1.0f;
this->lat1 = this->from.x * M_PI / 180;
this->lat2 = this->to.x * M_PI / 180;
// маршрут надо строить через тихий океан
if ( ( ( this->lon_range ) > ( 360 - this->lon_range ) ) && ( this->from.y * this->to.y < 0 ) ) {
this->via_pacific = true;
this->sign *= -1;
this->lon_range = 360 - this->lon_range;
this->lon1 = ( ( this->from.y > 0 ) ? ( -180 + this->from.y ) : ( 180 + this->from.y ) ) * M_PI / 180;
this->lon2 = ( ( this->to.y > 0 ) ? ( -180 + this->to.y ) : ( 180 + this->to.y ) ) * M_PI / 180;
this->current = Vec2f( this->from.x, this->lon1 * 180 / M_PI );
} else {
this->lon1 = this->from.y * M_PI / 180;
this->lon2 = this->to.y * M_PI / 180;
}
this->step_parity = 0;
this->max_steps = round( lon_range / step_lon );
this->steps = 0;
this->step_cycle = 0;
}