Matrix Transformations & Linear Algebra
Translate a Cube
A 4×4 homogeneous matrix translates the cube without rotating it.
matrix_transform_3d([[1,0,0,1.2],[0,1,0,0.4],[0,0,1,-0.6],[0,0,0,1]]) is a homogeneous translation by (1.2, 0.4, −0.6). The upper-left 3×3 block is the identity, so the cube is not rotated or scaled.
The last row is [0, 0, 0, 1], which is required for this affine map. A point (x, y, z, 1) goes to (x+1.2, y+0.4, z−0.6, 1). This translation does not fix the origin, so it is not a linear map.
Equation
matrix_transform_3d([[1,0,0,1.2],[0,1,0,0.4],[0,0,1,-0.6],[0,0,0,1]])
How the matrix is drawn
Matrix transformation examples draw a linear or affine map on the graph board. A 2×2 command uses the flat JSXGraph board. A 3×3 or 4×4 command uses the existing 3D viewer, with the original shape kept as a transparent reference. The rule is column vectors: the matrix multiplies on the left.
Eigenvector pictures reuse the same eigenvalue routine as Solve Equation and only draw real directions. SVD pictures reuse the existing factorization. The animation is a straight path from the identity to the target, or the three SVD stages, and a singular matrix is shown rather than rejected. Generate Graph is the action that opens each of these scenes.
Reading the input
matrix_transform_3d([[1,0,0,1.2],[0,1,0,0.4],[0,0,1,-0.6],[0,0,0,1]])— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Try a change
- Press Play, then Reset. The motion starts at the identity and ends on the matrix in the field.
- For a 2×2 transformation, move one entry slider. The determinant and the picture update without reloading the page.
Generate Graph opens this command on the matrix board. A 2×2 scene uses JSXGraph. A 3×3 or 4×4 scene uses the existing 3D viewer, including its camera and export path. Play, pause, and reset stay with the scene.