Woodylepic
New member
- Joined
- Dec 29, 2009
- Messages
- 71
- Reaction score
- 0
- Points
- 0
Hi all
What is the api to get the acceleration of a vessel ?
thank.
What is the api to get the acceleration of a vessel ?
thank.
Get the force vector and divide by the mass of the vessel.
Yes. The force vector is in vessel local frame, so you can get the y component for vertical and x,z for horizontal.Can you use this to get separate vertical and horizontal acceleration?. By that I mean calculate them from the direction of the vector?
Yes, you can convert the force vector to any frame of reference you want and use the individual elements. Edit: Counter-:ninja:ed by orb!Can you use this to get separate vertical and horizontal acceleration?. By that I mean calculate them from the direction of the vector?
If you just want the horizontal acceleration in the direction of a base, drop out the vertical component of the acceleration in the horizon frame and take the dot product of the resulting (two dimensional) vector with the (two dimensional) unit vector in the direction of the base. This is similar to my calculation for total acceleration in the article I linked, but with the additional step of converting both vectors to the horizon frame and dropping their vertical components.Thanks a 1E6 :thumbup:
EDIT: Actually I was mostly interested in the Horizontal Acc. SurfaceMFD lists Total and Vert. Acc.
I'm trying to figure out the easiest way to display the horizontal acceleration towards a landing target(base). I guess dDist/dt is the way to go in this case.
PS: I can't code myself out of a torn paper bag, but I intend to do something about that. :lol:
Edit: As TJohns hinted at above, for longer distances you will need to take into account the curvature of the earth when you're calculating the direction vector to the base.
and quick reply ! :thumbup: and good win !:rofl:Yeah, if a stepwise method works for you, go for it, it's definitely simpler than calculating it fully. For my purposes, I couldn't use the stepwise method due to the distributed nature of the system, so I had to come up with the calculations.I'm thinking GetFocusEquPos() and GetBaseEquPos() and calculating the distance/CourseToSteer (spherical). This way planet rotation doesn't get involved.
Clarification: I'm getting GetFocusEquPos() every time step, so I can get HorizVel From the ÄDistance. If I then divide the ÄHorizVel by time step length I should get a useful horizontal acceleration. If the base is within a few degrees of the actual course, this method should be close enough.