@thedro said:
Sorry, I realize how unclear that was since wanting to separate isn't related to the same situation as combining them.
How very true. In the math world this is generally called matrix decomposition, and there are various schemes to do so depending on what information you're looking to extract. Some information is really easy to find, others are very hard.
Scaling isn't to bad however. If you use the transforms .to_a method you'll get a 16 number array. It's best to think of this array as a 4x4 grid, with each group of four entries being one column of the matrix. The reason for this is that you can then interpret each column meaningfully by looking at your axis will change with respect to the transformation. If you think of your coordinate system as an x, y and z-axis together with an origin, then the first column is your x-axis, the second your y-axis, and the third your z-axis and the last column the origin. The only trouble here is that all of the columns have four entries while each of those vectors should only have three. This is pretty easy to resolve however since the last entry of the first three columns will always be 0, and the last entry of the final column will almost always be 1.
I say almost always because there is one important exception, which is that if you use use the Transformation.scaling method, then this entry will be the reciprocal of the scaling factor. So for example Geom::Transformation.scaling(2).to_a[-1] will return 0.5, which is 1/2. This somewhat complicates finding the scale factor in that you can't just look at the length of the x-axis in the transformation to find the x-axis scaling, but you can however divide by the this value to achieve the full scaling in that direction. In general you can always take a transformation's array and divide each entry by the value in that last column to "normalize" the last value to 1 without actually changing how the transformation works. I won't bore you with the logic behind why they use this scheme, just know that it simplifies the math behind a number of common operations in computer graphics so they aren't just trying to invoke your wrath.