0
$\begingroup$

Example: If I have a line rotated (at its center) by -45 degress on the x, y, and z axis what formula would I used to determine what angle that object is at if you put it back on a cartesian plane?

The higher level version is css transforms. Rotating is made easy but to handle mouse drag events I need to know what direction (on a cartesian plane) the object is pointing.

  • 0
    Have you heard of polar coordinates?2012-12-26
  • 0
    Yeah I've heard of them. I intend to relearn the math for this because of the new avenues being opened up for web developers. But right now I'm just hoping for a magic formula that accepts x, y, z and spits out an angle.2012-12-26
  • 0
    Note that rotation in 3D is not commutative. That is, rotating about $x$ then $y$ then $z$ is not the same as say rotating about $z$ then $y$ then $x$, or rotating in any other order. (This is why CSS transforms don't allow you to directly specify angles for $x$, $y$ and $z$ in a single `rotate3d` command; that would be meaningless.) What you are asking for is ambiguous unless you specify the order in which these rotations are performed.2012-12-26

1 Answers 1