Re: Finding all angles within a range of directions; an algorithm question [message #30316 is a reply to message #30240] |
Tue, 16 April 2002 08:56  |
tbowers0
Messages: 11 Registered: August 2001
|
Junior Member |
|
|
Wow Struan! Your explanation was a bit beyond me. So, instead of just
replying "Uhh.. Huh?" I did some surfing on rotation matrices and
stuff and found the Matrix and Quaternion FAQ at
http://skal.planet-d.net/demo/matrixfaq.htm. Educated myself a bit,
but I'm still unclear. If I understand:
Struan Gray <struan.gray@sljus.lu.se wrote
> Construct a rotation matrix which describes a rotation of the
> original angular coordinates into the 'reference frame' of the plate,
> i.e. which translates theta and phi into theta* and phi* where theta*
> is the angle from the plate normal.
So I need to build a polar coord. rotation matrix for the plate
normal's current 'pointing' direction, right?
I can't find a formula for this in polar coords. The above FAQ
(Question 35) talks only about "Euler angles" which I think are
cartesian xyz.
> Then just do a matrix multiply (fast in IDL) and find the items
> with theta* less than 90 degrees. You can probably speed it up by not
> bothering to calculate phi* at all, and do a matrix multiply with
> a vector to just find theta*.
I think you mean matrix multiply the above mentioned polar angle
rotation matrix with some other matrix or vector, but I'm not sure
what? All I have are 2 arrays of theta and phi. To clarify my example,
I have vector of theta angles (shown across top), vector of phi
azimuthal angles (shown here down left side), and 2D array of float
data values for each angle.
0 45 90 135 180
0 7.0 5.0 1.1 0.5 0.1
90 9.0 6.0 1.5 0.9 0.1
180 7.0 5.5 1.2 0.5 0.1
270 3.0 2.0 0.8 0.2 0.0
and say my plate rotation theta,phi angle is 45,0 (45 degrees from
vertical and due North)
Or, in IDL speak:
theta = [0,45,90,135,180]
phi = [0,90,180,270]
B = [[7.0,5.0,1.1,0.5,0.1], $
[9.0,6.0,1.5,0.9,0.1], $
[7.0,5.5,1.2,0.5,0.1], $
[3.0,2.0,0.8,0.2,0.0]]
plateRotationAngle = [45,0]
So I need to build a polar coord. rotation matrix for
plateRotationAngle and multiply this by some other matrix? And then
just do something like where(result lt 90)? I'm not sure what you mean
here.
> You can either keep track of the time values by suitable
> identity elements in the rotation matrix, or seperate out the
> angular information and use where/histogram/compare* to find
> the indices of the elements you want.
Hmm.. not sure at all what you mean here, except the possible use of
where. What's compare?
I must thank you very much Straun. This is becoming extremely
educational! Many thanks for your help on this!
todd
|
|
|