您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GeoVector函数代码示例

51自学网 2021-06-01 21:03:14
  C++
这篇教程C++ GeoVector函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GeoVector函数的典型用法代码示例。如果您正苦于以下问题:C++ GeoVector函数的具体用法?C++ GeoVector怎么用?C++ GeoVector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GeoVector函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetStartRadial

OZBoundaryAnnularSectorZone::GetBoundary() const{  OZBoundary boundary;  const unsigned steps = 20;  const Angle delta = Angle::FullCircle() / steps;  const Angle start = GetStartRadial().AsBearing();  Angle end = GetEndRadial().AsBearing();  if (end <= start + Angle::FullCircle() / 512)    end += Angle::FullCircle();  const GeoPoint inner_start =    GeoVector(GetInnerRadius(), GetStartRadial()).EndPoint(GetReference());  const GeoPoint inner_end =    GeoVector(GetInnerRadius(), GetEndRadial()).EndPoint(GetReference());  GeoVector inner_vector(GetInnerRadius(), start + delta);  for (; inner_vector.bearing < end; inner_vector.bearing += delta)    boundary.push_front(inner_vector.EndPoint(GetReference()));  boundary.push_front(inner_end);  boundary.push_front(inner_start);  GeoVector vector(GetRadius(), start + delta);  for (; vector.bearing < end; vector.bearing += delta)    boundary.push_front(vector.EndPoint(GetReference()));  boundary.push_front(GetSectorEnd());  boundary.push_front(GetSectorStart());  return boundary;}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:33,


示例2: GeoVector

GeoPointAircraftSim::endpoint(const Angle &heading, const fixed timestep) const{  GeoPoint ref = GeoVector(state.true_airspeed*timestep, heading).end_point(state.location);  return GeoVector(state.wind.norm*timestep,                   state.wind.bearing+ Angle::degrees(fixed_180)).end_point(ref);}
开发者ID:macsux,项目名称:XCSoar,代码行数:7,


示例3: switch

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);  };}
开发者ID:galippi,项目名称:xcsoar,代码行数:28,


示例4: fixed

const FlatBoundingBox AirspaceCircle::get_bounding_box(const TaskProjection& task_projection) {  static const Angle a225 = Angle::degrees(fixed(225));  static const Angle a135 = Angle::degrees(fixed(135));  static const Angle a045 = Angle::degrees(fixed(045));  static const Angle a315 = Angle::degrees(fixed(315));  const fixed eradius = m_radius * fixed(1.42);  const GeoPoint ll = GeoVector(eradius, a225).end_point(m_center);  const GeoPoint lr = GeoVector(eradius, a135).end_point(m_center);  const GeoPoint ur = GeoVector(eradius, a045).end_point(m_center);  const GeoPoint ul = GeoVector(eradius, a315).end_point(m_center);  FlatGeoPoint fll = task_projection.project(ll);  FlatGeoPoint flr = task_projection.project(lr);  FlatGeoPoint ful = task_projection.project(ul);  FlatGeoPoint fur = task_projection.project(ur);  // note +/- 1 to ensure rounding keeps bb valid   return FlatBoundingBox(FlatGeoPoint(min(fll.Longitude, ful.Longitude) - 1,                                      min(fll.Latitude, flr.Latitude) - 1),                         FlatGeoPoint(max(flr.Longitude, fur.Longitude) + 1,                                      max(ful.Latitude, fur.Latitude) + 1));}
开发者ID:Plantain,项目名称:XCSoar,代码行数:26,


示例5: GetHome

GeoVector AbortTask::GetHomeVector(const AircraftState &state) const{  const Waypoint *home_waypoint = GetHome();  if (home_waypoint)    return GeoVector(state.location, home_waypoint->location);  return GeoVector(fixed_zero);}
开发者ID:FlorianR,项目名称:XCSoar,代码行数:9,


示例6: getStartRadial

GeoPoint BGAEnhancedOptionZone::get_boundary_parametric(fixed t) const{   const Angle half = getStartRadial().HalfAngle(getEndRadial());  const Angle angle = (Angle::radians(t*fixed_two_pi)+half).as_bearing();  if (angleInSector(angle)) {    return GeoVector(Radius, angle).end_point(get_location());  } else {    return GeoVector(fixed(500), angle).end_point(get_location());  }}
开发者ID:galippi,项目名称:xcsoar,代码行数:11,


示例7: GetVector

  GeoVector   GetVector(fixed time) const  {    assert(Ready());    if (!positive(p[2].t-p[1].t)) {      return GeoVector(fixed_zero, Angle::zero());    }    const Record r0 = Interpolate(time - fixed(0.05));    const Record r1 = Interpolate(time + fixed(0.05));    return GeoVector(p[1].loc.distance(p[2].loc)/                     (p[2].t-p[1].t), r0.loc.bearing(r1.loc));  }
开发者ID:macsux,项目名称:XCSoar,代码行数:14,


示例8: if

GeoPointAnnularSectorZone::GetBoundaryParametric(fixed t) const{  const Angle sweep = (EndRadial-StartRadial).as_bearing();  const fixed c0 = sweep.value_radians()*InnerRadius;  const fixed l = Radius-InnerRadius;  const fixed c1 = sweep.value_radians()*Radius;  const fixed tt = t*(c0+c1+2*l);  Angle a;  fixed d;  if (tt< c0) {    d = InnerRadius;    a = Angle::radians((tt/c0)*sweep.value_radians())+StartRadial;  } else if (positive(l) && (tt<c0+l)) {    d = (tt-c0)/l*(Radius-InnerRadius)+InnerRadius;    a = EndRadial;  } else if (tt<c0+l+c1) {    d = Radius;    a = EndRadial-Angle::radians(((tt-c0-l)/c1)*sweep.value_radians());  } else if (positive(l)) {    d = (tt-c0-l-c1)/l*(InnerRadius-Radius)+Radius;    a = StartRadial;  } else {    d = InnerRadius;    a = StartRadial;  }  return GeoVector(d, a).end_point(get_location());}
开发者ID:macsux,项目名称:XCSoar,代码行数:28,


示例9: getStartRadial

GeoPoint KeyholeZone::get_boundary_parametric(fixed t) const{   const fixed sweep = (getEndRadial() - getStartRadial()).as_bearing().value_radians();  const fixed small_sweep = fixed_two_pi-sweep;  const fixed SmallRadius = fixed(500);  const fixed c1 = sweep*Radius; // length of sector element  const fixed c2 = small_sweep*SmallRadius*fixed(5); // length of cylinder element  const fixed l = (Radius-SmallRadius)*fixed(0.2); // length of straight elements  const fixed tt = t*(c1+l+l+c2); // total distance  Angle a;  fixed d;  if (tt<l) { // first straight element    d = (tt/l)*(Radius-SmallRadius)+SmallRadius;    a = getStartRadial();  } else if (tt<l+c1) { // sector element    d = Radius;    a = getStartRadial() + Angle::radians((tt-l)/c1*sweep);  } else if (tt<l+l+c1) { // second straight element    d = (fixed_one-(tt-l-c1)/l)*(Radius-SmallRadius)+SmallRadius;    a = getEndRadial();  } else { // cylinder element    d = SmallRadius;    a = getEndRadial() + Angle::radians((tt-l-l-c1)/c2*small_sweep);  }  return GeoVector(d, a).end_point(get_location());}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:27,


示例10: OnPaintListItem

static voidOnPaintListItem(Canvas &canvas, const PixelRect rc, unsigned i){  if (waypoint_select_info.empty()) {    assert(i == 0);    const UPixelScalar line_height = rc.bottom - rc.top;    const Font &name_font =      *UIGlobals::GetDialogLook().list.font;    canvas.SetTextColor(COLOR_BLACK);    canvas.Select(name_font);    canvas.text(rc.left + line_height + Layout::FastScale(2),                rc.top + line_height / 2 - name_font.GetHeight() / 2,                filter_data.IsDefined() || way_points.IsEmpty() ?                _("No Match!") : _("Choose a filter or click here"));    return;  }  assert(i < waypoint_select_info.size());  const struct WaypointSelectInfo &info = waypoint_select_info[i];  WaypointListRenderer::Draw(canvas, rc, *info.waypoint,                             GeoVector(info.distance, info.direction),                             UIGlobals::GetDialogLook(),                             UIGlobals::GetMapLook().waypoint,                             CommonInterface::GetMapSettings().waypoint);}
开发者ID:mobotics,项目名称:XCSoar,代码行数:28,


示例11: GetVector

  GeoVector   GetVector(fixed _time) const  {    assert(Ready());    if (!positive(p[2].time-p[1].time))      return GeoVector(fixed(0), Angle::Zero());    const Record r0 = Interpolate(_time - fixed(0.05));    const Record r1 = Interpolate(_time + fixed(0.05));    fixed speed = p[1].location.Distance(p[2].location) / (p[2].time - p[1].time);    Angle bearing = r0.location.Bearing(r1.location);    return GeoVector(speed, bearing);  }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:16,


示例12: GetVector

  GeoVector   GetVector(fixed time) const  {    if (!Ready())      return fixed_zero;    if (!positive(p[2].t-p[1].t)) {      return GeoVector(fixed_zero, Angle::native(fixed_zero));    }    fixed alt, palt;    GeoPoint p0, p1;    Interpolate(time-fixed(0.05), p0, alt, palt);    Interpolate(time+fixed(0.05), p1, alt, palt);    return GeoVector(p[1].loc.distance(p[2].loc)/                     (p[2].t-p[1].t), p0.bearing(p1));  }
开发者ID:galippi,项目名称:xcsoar,代码行数:16,


示例13: GetStartRadial

GeoPointAnnularSectorZone::GetBoundaryParametric(fixed t) const{  const Angle sweep = (GetEndRadial() - GetStartRadial()).AsBearing();  const fixed c0 = sweep.Radians() * inner_radius;  const fixed l = GetRadius() - inner_radius;  const fixed c1 = sweep.Radians() * GetRadius();  const fixed tt = t * (c0 + c1 + 2 * l);  Angle a;  fixed d;  if (tt < c0) {    d = inner_radius;    a = Angle::Radians((tt / c0) * sweep.Radians()) + GetStartRadial();  } else if (positive(l) && (tt < c0 + l)) {    d = (tt - c0) / l * (GetRadius() - inner_radius) + inner_radius;    a = GetEndRadial();  } else if (tt < c0 + l + c1) {    d = GetRadius();    a = GetEndRadial()        - Angle::Radians(((tt - c0 - l) / c1) * sweep.Radians());  } else if (positive(l)) {    d = (tt - c0 - l - c1) / l * (inner_radius - GetRadius()) + GetRadius();    a = GetStartRadial();  } else {    d = inner_radius;    a = GetStartRadial();  }  return GeoVector(d, a).EndPoint(GetReference());}
开发者ID:alon,项目名称:xcsoar,代码行数:29,


示例14: assert

voidTrafficListWidget::UpdateList(){  assert(filter_widget != nullptr);  items.clear();  last_update.Clear();  const TCHAR *callsign = filter_widget->GetValueString(CALLSIGN);  if (!StringIsEmpty(callsign)) {    FlarmId ids[30];    unsigned count = FlarmDetails::FindIdsByCallSign(callsign, ids, 30);    for (unsigned i = 0; i < count; ++i)      AddItem(ids[i]);  } else {    /* if no filter was set, show a list of current traffic and known       traffic */    /* add live FLARM traffic */    for (const auto &i : CommonInterface::Basic().flarm.traffic.list) {      AddItem(i.id);    }    /* add FLARM peers that have a user-defined color */    for (const auto &i : traffic_databases->flarm_colors) {      Item &item = AddItem(i.first);      item.color = i.second;    }    /* add FLARM peers that have a user-defined name */    for (const auto &i : traffic_databases->flarm_names) {      AddItem(i.id);    }#ifdef HAVE_SKYLINES_TRACKING_HANDLER    /* show SkyLines traffic unless this is a FLARM traffic picker       dialog (from dlgTeamCode) */    if (action_listener == nullptr) {      const auto &data = tracking->GetSkyLinesData();      const ScopeLock protect(data.mutex);      for (const auto &i : data.traffic) {        items.emplace_back(i.first, i.second.location);        Item &item = items.back();        if (i.second.location.IsValid() &&            CommonInterface::Basic().location_available)          item.vector = GeoVector(CommonInterface::Basic().location,                                  i.second.location);      }    }#endif  }  GetList().SetLength(items.size());  UpdateVolatile();  UpdateButtons();}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:59,


示例15: GeoVector

const GeoVector &WaypointListItem::GetVector(const GeoPoint &location) const{  if (!vec.IsValid())    vec = GeoVector(location, waypoint->location);  return vec;}
开发者ID:MindMil,项目名称:XCSoar,代码行数:8,


示例16: GeoVector

GeoQuaternion::GeoQuaternion( const GeoVector& rotation_axis, const float degrees ){	GeoVector normalized_rotation_axis = GeoVector(rotation_axis).Normalize();	const float radians = GeoConvertToRadians( degrees );    x = sin( radians / 2.0f ) * normalized_rotation_axis.x;    y = sin( radians / 2.0f ) * normalized_rotation_axis.y;    z = sin( radians / 2.0f ) * normalized_rotation_axis.z;    w = cos( radians / 2.0f );}
开发者ID:MishaConway,项目名称:simple3d,代码行数:9,


示例17: GeoVector

GeoVectorTaskLeg::GetNominalLegVector() const{  if (!GetOrigin()) {    return GeoVector(fixed(0));  } else {    return memo_nominal.calc(GetOrigin()->GetLocation(),                             destination.GetLocation());  }}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:10,


示例18: GeoVector

GeoVector TaskLeg::leg_vector_planned() const{  if (!origin()) {    return GeoVector(fixed_zero);  } else {    return memo_planned.calc(origin()->get_location_remaining(),                              destination.get_location_remaining());  }}
开发者ID:galippi,项目名称:xcsoar,代码行数:10,


示例19: GeoVector

const GeoVector &AirspaceSelectInfo::GetVector(const GeoPoint &location,                              const FlatProjection &projection) const{  if (!vec.IsValid()) {    const auto closest_loc = airspace->ClosestPoint(location, projection);    vec = GeoVector(location, closest_loc);  }  return vec;}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:11,


示例20: GeoVector

GeoVector AbortTask::get_vector_home(const AIRCRAFT_STATE &state) const{  const Waypoint* home_waypoint = waypoints.find_home();  if (home_waypoint) {    return GeoVector(state.Location, home_waypoint->Location);  } else {    GeoVector null_vector(fixed_zero);    return null_vector;  }}
开发者ID:Plantain,项目名称:XCSoar,代码行数:11,


示例21: GeoVector

GeoVector GeoVectorMemento::calc(const GeoPoint& _origin,                       const GeoPoint& _destination) const{  if (negative(value.Distance) || (_origin != origin)||(_destination != destination)) {    origin = _origin;    destination = _destination;    value = GeoVector(origin,destination);  };  return value;}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:11,


示例22: GetSpeed

AircraftStateAircraftStateFilter::GetPredictedState(const double in_time) const{  AircraftState state_next = last_state;  state_next.ground_speed = GetSpeed();  state_next.vario = GetClimbRate();  state_next.altitude = last_state.altitude + state_next.vario * in_time;  state_next.location = GeoVector(state_next.ground_speed * in_time,                                  GetBearing()).EndPoint(last_state.location);  return state_next;}
开发者ID:Advi42,项目名称:XCSoar,代码行数:11,


示例23: coordinates

std::vector<GeoVector>ReferenceElement::refCoor() const{    std::vector<GeoVector> coordinates (M_nbDof, GeoVector (3) );    for (UInt i (0); i < M_nbDof; ++i)    {        coordinates[i][0] = M_refCoor[3 * i];        coordinates[i][1] = M_refCoor[3 * i + 1];        coordinates[i][2] = M_refCoor[3 * i + 2];    }    return coordinates;}
开发者ID:Danniel-UCAS,项目名称:lifev,代码行数:12,


示例24: mac_cready

GlideResultRoutePolar::SolveTask(const GlideSettings &settings,                      const GlidePolar& glide_polar,                       const SpeedVector& wind,                       const Angle theta, const bool glide) const{  const MacCready mac_cready(settings, glide_polar);  GlideState task(GeoVector(fixed(1), theta), fixed(0), fixed(0), wind);  return glide    ? mac_cready.SolveStraight(task)    : mac_cready.Solve(task);}
开发者ID:MindMil,项目名称:XCSoar,代码行数:12,


示例25: TestGetNearest

static voidTestGetNearest(const Waypoints &waypoints, const GeoPoint &center){  WaypointPtr waypoint;  GeoPoint near = GeoVector(fixed(250), Angle::Degrees(15)).EndPoint(center);  GeoPoint far = GeoVector(fixed(750), Angle::Degrees(15)).EndPoint(center);  GeoPoint further = GeoVector(fixed(4200), Angle::Degrees(48)).EndPoint(center);  ok1((waypoint = waypoints.GetNearest(center, fixed(1))) != NULL);  ok1(waypoint->original_id == 0);  ok1((waypoint = waypoints.GetNearest(center, fixed(10000))) != NULL);  ok1(waypoint->original_id == 0);  ok1((waypoint = waypoints.GetNearest(near, fixed(1))) == NULL);  ok1((waypoint = waypoints.GetNearest(near, fixed(10000))) != NULL);  ok1(waypoint->original_id == 0);  ok1((waypoint = waypoints.GetNearest(far, fixed(1))) == NULL);  ok1((waypoint = waypoints.GetNearest(far, fixed(10000))) != NULL);  ok1(waypoint->original_id == 1);  ok1((waypoint = waypoints.GetNearestLandable(center, fixed(1))) != NULL);  ok1(waypoint->original_id == 0);  ok1((waypoint = waypoints.GetNearestLandable(center, fixed(10000))) != NULL);  ok1(waypoint->original_id == 0);  ok1((waypoint = waypoints.GetNearestLandable(further, fixed(1))) == NULL);  ok1((waypoint = waypoints.GetNearestLandable(further, fixed(10000))) != NULL);  ok1(waypoint->original_id == 3);  ok1((waypoint = waypoints.GetNearestIf(center, fixed(1), OriginalIDAbove5)) == NULL);  ok1((waypoint = waypoints.GetNearestIf(center, fixed(10000), OriginalIDAbove5)) != NULL);  ok1(waypoint->original_id == 6);}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:40,


示例26: GeoVector

GeoVector GeoVectorMemento::calc(const GeoPoint& _origin,                       const GeoPoint& _destination) const{  if (!value.IsValid() ||      _origin != origin ||      _destination != destination) {    origin = _origin;    destination = _destination;    value = GeoVector(origin, destination);  }  return value;}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:14,



注:本文中的GeoVector函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ Gestalt函数代码示例
C++ GeoIP_open函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。