本文整理汇总了C++中Velocity::trk方法的典型用法代码示例。如果您正苦于以下问题:C++ Velocity::trk方法的具体用法?C++ Velocity::trk怎么用?C++ Velocity::trk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Velocity
的用法示例。
在下文中一共展示了Velocity::trk方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::pair<LatLonAlt,Velocity> KinematicsLatLon::vsAccel(const LatLonAlt& so, const Velocity& vo, double t, double a) {
double dist = vo.gs()*t;
double currentTrk = vo.trk();
LatLonAlt sn = GreatCircle::linear_initial(so, currentTrk, dist);
double nsz = so.alt() + vo.z*t + 0.5*a*t*t;
sn = sn.mkAlt(nsz);
Velocity vn = vo.mkVs(vo.z + a*t);
return std::pair<LatLonAlt,Velocity>(sn,vn);
}
示例2: clockwise
/**
* Given two points on a turn and the velocity (direction) at the first point, determine the direction for the shortest turn going through the second point,
* returning true if that relative direction is to the right
*/
bool ProjectedKinematics::clockwise(Position s1, Velocity v1, Position s2) {
double trk1 = v1.trk();
double trk2;
if (s1.isLatLon()) {
trk2 = GreatCircle::velocity_initial(s1.lla(), s2.lla(), 1).trk();
} else {
trk2 = s2.point().Sub(s1.point()).vect2().track();
}
return Util::clockwise(trk1, trk2);
}
示例3: createProjection
std::pair<Position,Velocity> ProjectedKinematics::gsAccel(const Position& so, const Velocity& vo, double t, double a) {
Vect3 s3 = so.point();
if (so.isLatLon()) {
s3 = Projection::createProjection(so.lla().zeroAlt()).project(so);
}
Vect3 pres = Kinematics::gsAccelPos(s3,vo,t,a);
Velocity vres = Velocity::mkTrkGsVs(vo.trk(),vo.gs()+a*t,vo.vs());
if (so.isLatLon()) {
return Projection::createProjection(so.lla().zeroAlt()).inverse(pres,vres,true);
} else {
return std::pair<Position,Velocity>(Position(pres), vres);
}
}
示例4: closestDistOnTurn
double KinematicsLatLon::closestDistOnTurn(const LatLonAlt& s0, const Velocity& v0, double R, int dir, const LatLonAlt& x, double maxDist) {
LatLonAlt cent = center(s0, v0.trk(), R, dir);
if (x.mkAlt(0).almostEquals(cent.mkAlt(0))) return -1.0;
double ang1 = GreatCircle::initial_course(cent,s0);
double ang2 = GreatCircle::initial_course(cent,x);
double delta = Util::turnDelta(ang1, ang2, dir);
double t = GreatCircle::small_circle_arc_length(R, delta);
if (maxDist > 0 && (t < 0 || t > maxDist)) {
double maxD = 2*M_PI*R;
if (t > (maxD + maxDist) / 2) {
return 0.0;
} else {
return maxDist;
}
}
return t;
}
示例5: turnRadiusByRate
std::pair<LatLonAlt,Velocity> KinematicsLatLon::turnOmegaAlt(const LatLonAlt& so, const Velocity& vo, double t, double omega) {
double currentTrk = vo.trk();
double perpTrk;
if (omega > 0.0) {
perpTrk = currentTrk+M_PI/2;
} else {
perpTrk = currentTrk-M_PI/2;
}
double radius = turnRadiusByRate(vo.gs(), omega);
LatLonAlt center = GreatCircle::linear_initial(so, perpTrk, radius);
//f.pln("center="+center);
LatLonAlt sn = GreatCircle::small_circle_rotation(so,center,omega*t).mkAlt(so.alt()+vo.z*t);
double finalPerpTrk = GreatCircle::initial_course(sn,center);
double nTrk = finalPerpTrk - M_PI/2 * Util::sign(omega);
Velocity vn = vo.mkTrk(nTrk);
return std::pair<LatLonAlt,Velocity>(sn,vn);
}
示例6: center
LatLonAlt KinematicsLatLon::center(const LatLonAlt& s0, const Velocity& v0, double omega) {
double v = v0.gs();
double R = v/omega;
return center(s0, v0.trk(), R, Util::sign(omega));
}
示例7: interpolateVelocity
// f should be between 0 and 1 to interpolate
Velocity VectFuns::interpolateVelocity(const Velocity& v1, const Velocity& v2, double f) {
double newtrk = v1.trk() + f*(v2.trk() - v1.trk());
double newgs = v1.gs() + f*(v2.gs() - v1.gs());
double newvs = v1.vs() + f*(v2.vs() - v1.vs());
return Velocity::mkTrkGsVs(newtrk,newgs,newvs);
}