本文整理汇总了C++中GeoPoint::DistanceBearing方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoPoint::DistanceBearing方法的具体用法?C++ GeoPoint::DistanceBearing怎么用?C++ GeoPoint::DistanceBearing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoPoint
的用法示例。
在下文中一共展示了GeoPoint::DistanceBearing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
ComputeFlarmTeam(const GeoPoint &location, const GeoPoint &reference_location,
const TrafficList &traffic_list, const FlarmId target_id,
TeamInfo &teamcode_info)
{
const FlarmTraffic *traffic = traffic_list.FindTraffic(target_id);
if (traffic == NULL || !traffic->location_available) {
teamcode_info.flarm_teammate_code_current = false;
return;
}
// Set Teammate location to FLARM contact location
teamcode_info.teammate_location = traffic->location;
teamcode_info.teammate_vector = location.DistanceBearing(traffic->location);
teamcode_info.teammate_available = true;
// Calculate distance and bearing from teammate to reference waypoint
GeoVector v = reference_location.DistanceBearing(traffic->location);
// Calculate TeamCode and save it in Calculated
teamcode_info.flarm_teammate_code.Update(v.bearing, v.distance);
teamcode_info.flarm_teammate_code_available = true;
teamcode_info.flarm_teammate_code_current = true;
}
示例2: gs
GlideResult
TaskSolution::GlideSolutionRemaining(const GeoPoint &location,
const GeoPoint &target,
const fixed target_elevation,
const fixed altitude,
const SpeedVector &wind,
const GlideSettings &settings,
const GlidePolar &polar)
{
GlideState gs(location.DistanceBearing(target),
target_elevation, altitude, wind);
return MacCready::Solve(settings, polar, gs);
}
示例3: AppendArc
void
AppendArc(const GeoPoint start, const GeoPoint end)
{
// Determine start bearing and radius
const GeoVector v = center.DistanceBearing(start);
Angle start_bearing = v.bearing;
const fixed radius = v.distance;
// 5 or -5, depending on direction
const auto _step = ArcStepWidth(radius);
const Angle step = Angle::Degrees(rotation * _step);
const fixed threshold = _step * fixed(1.5);
// Determine end bearing
Angle end_bearing = center.Bearing(end);
if (rotation > 0) {
while (end_bearing < start_bearing)
end_bearing += Angle::FullCircle();
} else if (rotation < 0) {
while (end_bearing > start_bearing)
end_bearing -= Angle::FullCircle();
}
// Add first polygon point
points.push_back(start);
// Add intermediate polygon points
while ((end_bearing - start_bearing).AbsoluteDegrees() > threshold) {
start_bearing += step;
points.push_back(FindLatitudeLongitude(center, start_bearing, radius));
}
// Add last polygon point
points.push_back(end);
}
示例4:
GeoVector::GeoVector(const GeoPoint &source, const GeoPoint &target)
{
*this = source.DistanceBearing(target);
}