function A_i = A_matrix(rot_z, trans_z, trans_x, rot_x)
    row_1 = [cos(rot_z) -sin(rot_z)*cos(rot_x) sin(rot_z)*sin(rot_x) trans_x*cos(rot_z)];
    row_2 = [sin(rot_z) cos(rot_z)*cos(rot_x) -cos(rot_z)*sin(rot_x) trans_x*sin(rot_z)];
    row_3 = [0 sin(rot_x) cos(rot_x) trans_z];
    row_4 = [0 0 0 1];
    A_i = [row_1; row_2; row_3; row_4;];
end