Hi,

my question is, why cframe is 4x4, when i can define rotation by vector 3 and position also by vector 3, so 2x3 is enough.

CFrame is 3 x 4. The first three are position, and the last 9 are parts of a rotation matrix. The rotation matrix can be viewed as what transformation takes the object to it’s current orientation. It’s useful, because if you view the components of the matrix 3 at a time, you have vectors which describe a coordinate system relative to the object. When you do CFrame:toObjectSpace(Point) you’re basically seeing how a point lies relative to an object using that coordinate system.

Also the rotation matrix is independent of the order of rotations, describing an orientation by 3 rotations requires knowledge of which axis you’re rotating around in which order.

Adding onto this, it uses matrix multiplication in order to perform transformations (with the last row being 0,0,0,1 (identity matrix values))

As said before, it is 3x4 but mathematically it is 4x4 in order to fulfill the matrix multiplication requirement (c1 == r2) (although the last row gets ignored in the end).

The math stems way back from rotation matrix operations. It includes a standard 3x3 rotation matrix and then positional values / coordinates follow for the last column. Matrix inversion is CFrame:inverse(). There should be a further explanation on the wiki and the concepts are explained elsewhere.

I found this

`These numbers may look daunting, but if we organize them a bit differently we can see that the columns represents the rightVector, upVector, and negative lookVector respectively.`

But why the rotation is so complicated, when i can define it by 1 vector 3?

Rotation in R3 about an axis through the origin is encoded by a 3x3 orthogonal matrix with a determinant of one. Doing so allows you to avoid singularities associated with representing rotation through 3 Euler angles. Roblox uses the right, up, and back vectors in order to construct a rotation matrix out of the 3 orthonormal row vectors.

fromAxisAngles defines CFrames using a single vector3 (and a roll). While one vector *can* define a direction, it cannot define a ‘roll’ or rotation about the axis it represents. While it is also possible to make a matrix from the direction (or two), it is also more computationally intensive to be calculating all of those components and then converting each and every time as opposed to just doing a matrix multiplication and returning the components. Theres several reasons for the nuances and design of CFrame (and these concepts are applicable in other places too as Ive made my own CFrame implementations for other projects) which is again discoverable by researching the topic and the article.