Lets say that I have a line with one end fixed to the center of a sphere, and the other end can freely rotate. If I were to rotate the line around the x and y axes, what would the coordinates be for the freely-rotating end?

Here's what I need this for:

I have a rectangle, and need to find the coordinates of each vertex when the rectangle is rotated (the rectangle will be rotated from its center at (0,0,0), and can have any width and height). I only need to rotate the rectangle around the x,y (or any pair really, but x,y are just a nice looking pair), because rotating the unincluded axis will be like rolling a pencil back and forth in your thumb.

I have found some helpful resources for questions similar to mine, but they don't solve my problem. For example, this here I've tried to understand, but I have minimal experience with matrices, and this doesn't exactly solve my problem.


1 Answer 1

  1. Let's take the sphere to be centered at the origin, (0,0,0).
  2. You say we have a line with one end fixed at the origin; say that the point on this line which is distance 1 from the origin is $v =(a,b,c).$ When I rotate $v$ around the $z$ axis, I won't change it's $z$ coordinate--this will still be $c.$ If I rotate by an angle of $\theta,$ the output vector will be $(cos(\theta)a - sin(\theta)b, sin(\theta)a + cos(\theta)b, c).$
  • $\begingroup$ If I were to then rotate the line along the x after rotating the z as you have shown, would I just input the coordinates from above into: y' = ycos q - zsin q z' = ysin q + zcos q and the x remains the same, would that work? $\endgroup$ Commented Mar 2, 2019 at 1:08
  • $\begingroup$ If there is an equation that exists which takes 2 rotations, that would be awesome $\endgroup$ Commented Mar 2, 2019 at 1:10
  • $\begingroup$ If you would like to first rotate $(a,b,c)$ by an angle of $\theta$ around the $z$ axis and then rotate the result by an angle of $\alpha$ around the $x$ axis, the output would be $(a cos(\theta) - b sin(\theta), a sin(\theta) cos(\alpha) + b cos(\theta) cos(\alpha) - c sin(\alpha), a sin(\theta) sin(\alpha) + b cos(\theta) sin(\alpha) + c cos(\alpha).$ $\endgroup$ Commented Mar 2, 2019 at 1:20
  • $\begingroup$ What would be the equation for rotating around x and around y? $\endgroup$ Commented Mar 2, 2019 at 2:17
  • $\begingroup$ also are the rotations "added" onto the line (like a rotation relative to the line), or does it rotate the line to an exact point as if the line could be anywhere, and always rotate to the same place each time? $\endgroup$ Commented Mar 2, 2019 at 3:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .