Replies: 3 comments 1 reply
-
I'm not aware of a property off-hand which tracks the cumulative distance. But if your code is running after each timestep then one option is to calculate the distance moved during each timestep and accumulate that yourself using ECEF coordinates. PropertyManager->Tie("position/ecef-x-ft", this, eX, (PMF)&FGPropagate::GetLocation);
PropertyManager->Tie("position/ecef-y-ft", this, eY, (PMF)&FGPropagate::GetLocation);
PropertyManager->Tie("position/ecef-z-ft", this, eZ, (PMF)&FGPropagate::GetLocation); |
Beta Was this translation helpful? Give feedback.
-
@judeurban what approach did you go with? |
Beta Was this translation helpful? Give feedback.
-
@judeurban any reason you didn't use the ECEF coordinates? Much simpler Pythagoras formula to calculate distance compared to the archaversine (inverse haversine) formula you've used. The haversine is calculating the great circle distance which isn't necessarily the path taken by the vehicle, although realistically given you're doing this each timestep you probably wouldn't notice a difference since the delta distances are so small. It also assumes a spherical earth based on a constant earth radius as opposed to a WGS84 ellipsoid model of the earth. Both these issues are avoided by using ECEF coordinates. |
Beta Was this translation helpful? Give feedback.
-
Hello, all.
I'm searching for a "cumulative distance since origin" parameter. Please note that this is different than the norm since the origin. It is the distance accumulated after each discrete timestep from one point to the next.
I've found the parameters below using JSB Reference Manual, but they provide the norm since$t = 0$ , not the cumulative distance.
position/distance-from-start-lat-mt
position/distance-from-start-lon-mt
position/distance-from-start-mag-mt
I've also attempted to utilize the FGLocation's
GetDistanceTo()
method to compute each distance myself. In theory, this is possible because I keep track of the latitude/longitude from the previous time step.Is there a property that does what I am looking for, or should I compute this information manually? Depending on your answer, perhaps this thread will be miscategorized in the Q&A section and would be better suited in the feature request section.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions