How to calculate the cylinder "upper" center of the circle, given the angles of rotation?

I have a 2f cylinder and the user defined data for RotX and RotZ. I also know that the "bottom" of my cylinder is at (0,0,0) (the center of the circle forming the "bottom")

I need to calculate the β€œtop” point (the center of the circle at the other end) that has data open in the top rows.

In my second image, point A is calculated as follows (sin (zAngle), cos (zAngle), sin (xAngle) with zAngle = PI / 4 (alpha angle) and xAngle = 0.
Point B is calculated as (sin (xAngle), cos (xAngle), sin (zAngle)) with xAngle = PI / 4 (beta angle) and zAngle = 0; C is the top of the cylinder with xAngle = PI / 4 and zAngle = PI / 4.
I need to find an algorithm to determine the "top" point for any given xAngle and zAngle.

I would be extremely grateful if anyone could help me.

RotZ and RotX explainedExample

+8
java math geometry 3d java-3d
source share
1 answer

Before turning, the top is at 2f * (0.1.0).

After the cylinder rotates around the z axis in the alpha angle, the upper part is at 2f * (sin alpha, cos alpha, 0).

If you now turn the cylinder a beta angle around the x axis, the top goes into 2f * (sin alpha, cos alpha * cos beta, cos alpha * beta).

+2
source share

All Articles