Questions tagged [rotational-matrices]

Rotational Matrices, also called direction cosine matrices, are matrices that represent a rotation from one coordinate frame to another in Euclidean space.

Rotational Matrices, also called direction cosine matrices, are matrices that represent a rotation from one coordinate frame to another in Euclidean space. They are always square, orthogonal, and include only real elements.

Rotational Matrices can easily be converted to other common rotation representations including and .

373 questions
132
votes
9 answers

Why are quaternions used for rotations?

I'm a physicist, and have been learning some programming, and have come across a lot of people using quaternions for rotations instead of writing things in matrix/vector form. In physics, there are very good reasons we don't use quaternions…
JMP
  • 1,457
  • 2
  • 10
  • 5
30
votes
11 answers

Rotating a NxN matrix in Java

This is a question from Cracking the Coding Interview. The solution says that the program rotates the exterior edges, then the interior edges. However, I'm having trouble following the logic of both the for loops. Could somebody explain the logic…
JGY
  • 303
  • 1
  • 3
  • 7
26
votes
4 answers

extract yaw, pitch, and roll from a rotationMatrix

I have a sensor manager that returns a rotationMatrix based on the devices Magnetometer and Accelerometer. I have been trying to also calculate the yaw pitch and roll of the user's device but am finding that pitch and roll interfere with each other…
erik
  • 4,946
  • 13
  • 70
  • 120
23
votes
4 answers

Three.js: Show world coordinate axes in corner of scene

I'd like to show arrows indicating the world coordinate directions (x, y, z) in the bottom right hand corner of the camera like is done in Maya, so that when rotating the camera around an object, or moving through a scene, you can still identify the…
18
votes
3 answers

Converting OpenCV rotation and translation vectors to XYZ rotation and XYZ position

There are Google results and stackoverflow posts that appear to answer this question, but the simple fact is I can't understand them. No matter how much I read, I can't get my head around quaternions and Euler angles and Rodriguez transforms and…
John
  • 565
  • 1
  • 5
  • 14
17
votes
7 answers

Eigen - Re-orthogonalization of Rotation Matrix

After multiplying a lot of rotation matrices, the end result might not be a valid rotation matrix any more, due to rounding issues (de-orthogonalized) One way to re-orthogonalize is to follow these steps: Convert the rotation matrix to an…
dim_tz
  • 1,451
  • 5
  • 20
  • 37
13
votes
5 answers

Make right hand turns

I have a problem where I have a bunch of lengths and want to start at the origin (pretend I'm facing to the positive end of the y axis), I make a right and move positively along the x axis for the distance of length_i. At this time I make another…
Tyler Rinker
  • 108,132
  • 65
  • 322
  • 519
12
votes
5 answers

Quaternions and numerical stability

I'm learning about unit quaternions and how to use them to represent and compose rotations. Wikipedia says they are more numerically stable than matrix representations, but doesn't give a reference. Can anyone explain to me (preferably with some…
rmp251
  • 5,018
  • 4
  • 34
  • 46
11
votes
5 answers

Calculate rotation matrix to align two vectors in 3D space?

I have two separate vectors of 3D data points that represent curves and I'm plotting these as scatter data in a 3D plot with matplotlib. Both the vectors start at the origin, and both are of unit length. The curves are similar to each other,…
Mark
  • 768
  • 3
  • 7
  • 23
11
votes
2 answers

Roll pitch and yaw from Rotation matrix with Eigen Library

I need to extract the roll pitch yaw angles from a rotation matrix and I want to be sure that what I do is correct. Eigen::Matrix< simFloat, 3, 1> rpy = orientation.toRotationMatrix().eulerAngles(0,1,2); const double r = ((double)rpy(0)); …
desmond13
  • 2,913
  • 3
  • 29
  • 46
11
votes
4 answers

Shear Matrix as a combination of basic transformation?

I know the transformation matrices for rotation, scaling, translation etc. I also know the matrix for shear transformation. Now, I need to have the shear matrix-- [1 Sx 0] [0 1 0] [0 0 1] in the form of a combination of other aforesaid…
10
votes
1 answer

How do axis-angle rotation vectors work and how do they compare to rotation matrices?

I'm having a bit of trouble understanding how axis-angle rotation vectors are used when rotating a vector in 3D space. Why are these used and how do these relate to rotation matrices? I also found a function called vrrotvec2mat that seems to do…
Pedro77
  • 5,176
  • 7
  • 61
  • 91
9
votes
1 answer

How can we change the rotation origin (pivot point) of a Three.js object without modifying scene tree structure or geometry?

I know we can make the object have a new parent to act as the pivot, or we could adjust the geometry position within the mesh. But how can we achieve this mathematically without reparenting the object or modifying the object's parent, and without…
trusktr
  • 44,284
  • 53
  • 191
  • 263
9
votes
3 answers

How to calculate extrinsic parameters of one camera relative to the second camera?

I have calibrated 2 cameras with respect to some world coordinate system. I know rotation matrix and translation vector for each of them relative to the world frame. From these matrices how to calculate rotation matrix and translation vector of one…
8
votes
1 answer

OpenCV Equirectangular Rotation

I'm currently stuck on achieving an equirectangular rotation on a 360° image with OpenCV because of my mathematical understanding (nearly zero) of projections and rotations matrixes. The result of a such rotation would be exactly what you can see…
Bueare
  • 89
  • 3
1
2 3
24 25