From: "Anthony Webber"
To: Martin Baker
Subject: Help a stupid person with a 3D velocity problem?
Date: 12 January 2003 13:26
Hi Martin,
Found your site whilst trying to find a formula to solve a problem I'm having. It's actually very simple, but I'm far too stupid. Could you possibly help? Well here goes, anyway just in case...
Consider the following setup:
We have an aircraft. The bodyaxis frame is centered at it's CG. We have x pointing forward, y pointing out over the right wing, and z pointing down. The velocity vectors along these axes are u, v and w respectively.
Take a case in which the plane is spinning  its CG is stationary  but it's rotating around all three axes. I am trying to find the instantaneous velocity of any arbitrary point (referenced by the point's x, y and z body coords)  not just the magnitude of that instantaneous velocity, but the components of the point's instantaneous velocity vector resolved in "local" terms, say u(local), v(local) and w(local)  i.e. these components would be parallel to  but not necessarily colinear with  u, v and w (which run through the CG).
I am totally stuck. You don't happen to have a nice little matrix floating around do you? ;)
Anyway, best regards (and nice site btw).
Anthony Webber
From: "Anthony Webber"
To: Martin Baker
Subject: Ooops forgot to mention something important...
Date: 12 January 2003 13:32
Sorry Martin,
I forgot to mention something rather important. The aircraft is spinning around its x y and z axes with angular velocities p, q and r respectively (these would be in radians per sec).
Dear oh dear;)
Anthony Webber
From: Martin Baker
To: "Anthony Webber"
Subject: Re: Help a stupid person with a 3D velocity problem?
Date: 12 January 2003 18:09
Hi Anthony,
If you are stupid, join the club, because I can't see an easy solution
either.
If we can find a way to specify its instantaneous orientation as a matrix
then we can easily transform its local coordinates to global coordinates,
and if we can find a way to specify its instantaneous orientation as euler
angles or quaternion or axisangle then we could convert to a matrix.
But how do we work out its instantaneous orientation?
Its tempting to say angle = angular velocity * time.
so,
theta x = wx *t
theta y = wy *t
theta z = wz *t
but this is not true, because the rules of arithmetic don't apply for
angular position in the same way that they do for angular velocity.
As you say, there must be a simple answer, but I don't know what it is. I'll
think about it and if inspiration strikes me I'll let you know.
Martin
PS. The more I think about it, this is a good example, do you mind if I put
it on my web site?
From: "Anthony Webber"
To: Martin Baker
Subject: Re: Help a stupid person with a 3D velocity problem?
Date: 13 January 2003 11:29
Martin,
Yup, it mustn't depend upon the orientation of the aircraft since we're working exclusively in body axes. This confuses me. I just knocked up the following code snippet (BASIClike), which seems to do the job, but... well, it *seems* to. The problem is that I'm simply not sure.
It would be great to see this subject the site for possible feedback? As you no doubt know, it's really important when it comes to determining wind forces (in wind axes) on wings, fins  which are, of course, all located at different positions relative to the aircraft CG.
Here's the code. I prefer thinking in code. Mathematical notation always scares me;)
; 
; Initialize the CG's velocity components.
_u = 0
_v = 0
_w = 0
_p = 0
_q = 0
_r = 0
; The position of the local point referenced to the CG in body axes.
_dx = 10
_dy = 3
_dz = 0.5
; Initialize the local point's velocity components (these are what we're trying
to find).
_lu = 0
_lv = 0
_lw = 0
; Bear in mind, OFP script trig functions expect / return angles in degrees,
so we therefore convert them as we go.
_xyarm = sqrt(_dx^2 + _dy^2)
_xyang = rad(_dy atan2 _dx)
_xyuarm = _xyarm * sin(deg(_xyang))
_xyvarm = _xyarm * cos(deg(_xyang))
_xzarm = sqrt(_dx^2 + _dz^2)
_xzang = rad(_dz atan2 _dx)
_xzuarm = _xzarm * sin(deg(_xzang))
_xzwarm = _xzarm * cos(deg(_xzang))
_yzarm = sqrt(_dy^2 + _dz^2)
_yzang = rad(_dz atan2 _dy)
_yzvarm = _yzarm * sin(deg(_yzang))
_yzwarm = _yzarm * cos(deg(_yzang))
; Contributions arising from r.
_rdu = _xyuarm * _r
_rdv = _xyvarm * _r
; Contributions arising from q.
_qdu = _xzuarm * _q
_qdw = _xzwarm * _q
; Contributions arising from p.
_pdv = _yzvarm * _p
_pdw = _yzwarm * _p
; Totals.
_lu = _u + _rdu + _qdu
_lv = _v + _rdv + _pdv
_lw = _w + _qdw + _pdw
exit
; 
From: Martin Baker
To: "Anthony Webber"
Subject: Re: Help a stupid person with a 3D velocity problem?
Date: 13 January 2003 16:54
Anthony,
When I was looking at your code I was wondering why there was not a time
factor in the equations, then I realised I was trying to answer the wrong
question! for some reason I misread it and thought you were trying to find
the instantaneous position but you said instantaneous velocity. Sorry about
confusing things like that, finding the instantaneous velocity is much
easier.
The instantaneous velocity due to the rotation is just the cross product of
the distance from the centre of rotation with the angular velocity.
v = r x w
where v is a vector representing the instantaneous velocity.
r is a vector to the point from the centre of rotation
w is a vector representing the angular velocity (along the axis of rotation)
x is the cross product operator
So expanding out the vectors into normal equations gives:
vx = ry * wz  wy * rz
vy = rz * wx  wz * rx
vz = rx * wy  wx * ry
So using your variable names gives:
_lu = _dy * wz  wy * _dz
_lv = _dz * wx  wz * _dx
_lw = _dx * wy  wx * _dy
Both v and w are in absolute coordinates. If you are in local coordinates
(i.e. sitting on the plane) it would appear to be stationary relative to
you.
I have put this at:
https://www.euclideanspace.com/physics/dynamics/tableTopPhysics/aircraft.htm
Let me know if you want me to remove your email address to avoid spam.
Martin
From: "Anthony Webber"
To: "Martin Baker"
Subject: Re: Help a stupid person with a 3D velocity problem?
Date: 16 January 2003 17:43
Hi Martin.
Took me a few days to revise my cross products  actually more like to
relearn vectors from scratch  and yes, it works!!
Many many thanks :)
Best regards,
Anthony
From: "Anthony Webber"
To: Martin Baker
Subject: Re: Help a stupid person with a 3D velocity problem?
Date: 16 January 2003 19:01
Hi Martin,
Just for the sake of completeness:
The correct equations expressed in terms of the variable names I originally
used, and adding on the velocity components of the CG, are:
_lu = _u + _q * _dz _r * _dy
_lv = _v + _r * _dx  _p * _dz
_lw = _w + _p * _dy _q * _dx
Anthony
metadata block 

see also:  
Correspondence about this page  
Book Shop  Further reading. Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them. 
Game Physics  This book has some useful stuff, its more of a textbook, not a step by step guide (although it does have a disc with a lot of C++ code). About the first third of the book is a physics textbook with theoretical exercises, the middle bit covers physics engine topics, and the last third of the book covers mathematical topics. I think I would use this book as a reference book to lookup the theory behind something I might be working on rather than a book to work through in order. 
Commercial Software Shop Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them. 

This site may have errors. Don't use for critical systems.
Copyright (c) 19982020 Martin John Baker  All rights reserved  privacy policy.