本文整理汇总了C++中GeoPoint::bearing方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoPoint::bearing方法的具体用法?C++ GeoPoint::bearing怎么用?C++ GeoPoint::bearing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoPoint
的用法示例。
在下文中一共展示了GeoPoint::bearing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GeoVector
GeoVector
TaskLeg::leg_vector_remaining(const GeoPoint &ref) const
{
switch (destination.getActiveState()) {
case OrderedTaskPoint::AFTER_ACTIVE:
if (!origin()) {
return GeoVector(fixed_zero);
}
// this leg totally included
return memo_remaining.calc(origin()->get_location_remaining(),
destination.get_location_remaining());
break;
case OrderedTaskPoint::CURRENT_ACTIVE:
if (!origin()) {
return GeoVector(fixed_zero,
ref.bearing(destination.get_location_remaining()));
}
// this leg partially included
return memo_remaining.calc(ref,
destination.get_location_remaining());
break;
case OrderedTaskPoint::BEFORE_ACTIVE:
// this leg not included
default:
assert(1); // error!
return GeoVector(fixed_zero);
};
}
示例2: min
void
AATPoint::get_target_range_radial(fixed &range, fixed &radial) const
{
const fixed oldrange = range;
const GeoPoint fprev = get_previous()->get_location_remaining();
const GeoPoint floc = get_location();
const Angle radialraw = (floc.bearing(get_location_target()) -
fprev.bearing(floc)).as_bearing();
const fixed d = floc.distance(get_location_target());
const fixed radius = floc.distance(get_location_min());
const fixed rangeraw = min(fixed_one, d / radius);
radial = radialraw.as_delta().value_degrees();
const fixed rangesign = (fabs(radial) > fixed(90)) ?
fixed_minus_one : fixed_one;
range = rangeraw * rangesign;
if ((oldrange == fixed_zero) && (range == fixed_zero))
radial = fixed_zero;
}