this is a bit more complicated than the post title suggests because I was running out of words. I suppose the full title would be: "Finding the distance between the centre of an arbitrarily rotated cylinder and a point on that cylinder which is the intersection of a ray projected from the centre of the cylinder at angles a and b, which are relative to the absolute axes."
To break it down a little:
I have a circular cylinder, which is rotated to an arbitrary orientation in 3D. I have the radius of the cylinder and I have a vector which is the vector along the cylinder's length (essentially the cylinder's orientation). The cylinder's height is infinite.
I also know the coordinates of the centre of the cylinder, let's call that point p. From p I draw a line in 3D in a direction specified by two angles, alpha and beta, which are angles of rotation in the cardinal axes of x and y (i.e. the absolute axes, and not relative to the cylinder). I would like to work out the point at which this line intersects the cylinder and also the distance between the two points.
So to break it down further:
1) I need to rotate the cylinder back to the origin, and then rotate the line by the exact same same angles to get them relative to the cylinder while the cylinder is at the origin.
2) Using this new point of reference, I need to calculate the point of intersection between the now transformed cylinder and the line made from the two transformed angles I have.
I can get x and y of this point by using rCosAlpha,rSinAlpha and I can get z by using rtanBeta (I have the adjacent - r (the radius) - and need the opposite)
And then I simply use Pythagoras' theorem to get the distance.
The problem is working this all out using these two frames of reference: absolute orientations and relative orientations. Or solving problem (1) so I don't have
Does anybody have any ideas?