What is the best way to calculate the angle of an element when applying several turns to it

If you make rotateX (180deg) rotateY (180deg), then turn it upside down. Therefore, if the mouse is configured to move the child up, this child will now move down (depending on how you configured all the settings).

-webkit-transform: rotateX(?deg) rotateY(?deg) rotateZ(?deg); // where does it point? 

enter image description here

WEBKIT SETUP ONLY

Take a look at the fiddle (code mess, stripped down). Draw 360 tick marks in a circle on your computer monitor. How can you determine what the arrow points to (if the field is in the exact center of the circle)?

The basics tutorial is here , here .

* edit - the conversion source used is in the center of the cube

+4
source share
1 answer

Note. All that follows assumes that you are using a vector that passes through the origin, as in this example . In your original example, the vector is further offset from the beginning by the vector [0, 0, 60] . This complicates the calculation a bit, so I used a simplified version in my explanation.

Your vector is currently defined by spherical coordinates Euler angles sequentially applied rotations to a predefined vector . Here's how you can use your rotations to determine the Cartesian coordinates of a finite vector:

  • Say your vector is [0, 1, 0] (if arrow 1 is one unit long and starts at the origin)
  • Apply the x, y, and z rotations by multiplying the vector by the rotation matrices described here in any order, replacing ΞΈ with the corresponding angle in each case:

    enter image description here

  • The resulting vector is your original vector, transformed using the given rotations x, y and z

Once you have a rotated vector, finding the projection of the vector onto the xy plane becomes easy.

For example, taking into account the vector [10, 20, 30] (Cartesian coordinates), the projection onto the xy plane is the vector [10, 20, 0] . The horizontal angle of this vector can be calculated as:

tan -1 (20/10) = 1.107 rad (counterclockwise from the positive x-axis)

= 63.43 degrees (counterclockwise from the positive x-axis)

This means that the arrow points between the 63rd and 64th β€œmark” marks, counting counterclockwise from the pointer pointing right to the right.

+4
source

All Articles