[Gcblue-commits] gcb_wx/src/common simmath.cpp,1.12,1.13
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-27 00:16:34
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10427/src/common Modified Files: simmath.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** simmath.cpp 19 Jul 2004 00:53:00 -0000 1.12 --- simmath.cpp 27 Jul 2004 00:16:23 -0000 1.13 *************** *** 454,457 **** --- 454,477 ---- } + /** + * Predicts position ahead by dt_s seconds + */ + void tcKinematics::PredictPosition(float dt_s, + double& lon_rad, double& lat_rad, float& alt_m) + { + float v = C_KTSTOMPS*mfSpeed_kts; + float vz = v*sinf(mfPitch_rad); + + float cospitch = cosf(mfPitch_rad); + float k = C_MTORAD * dt_s * v * cospitch; + float dlon = k * sinf(mfHeading_rad) / cosf(mfLat_rad); + float dlat = k * cosf(mfHeading_rad); + + lon_rad = mfLon_rad + dlon; + lat_rad = mfLat_rad + dlat; + alt_m = mfAlt_m + vz * dt_s; + + } + // returns radian heading to track float tcKinematics::HeadingToTrack(const tcTrack& track) { |