%% 3D Rotation
theta = pi/6; % 60 degrees around x axis
Rx = [1,          0,           0, 0
      0, cos(theta), -sin(theta), 0
      0, sin(theta),  cos(theta), 0
      0,           0,          0, 1];
phi = pi/4; % 45 degrees around y axis
Ry = [sin(phi),         0,   cos(phi), 0
      0,                1,          0, 0
      cos(phi),         0,  -sin(phi), 0
      0,                0,          0, 1];
psi = -pi/4; % -45 degrees around z axis
Rz = [cos(psi), -sin(psi), 0, 0
      sin(psi),  cos(psi), 0, 0
             0,         0, 1, 0
             0,         0, 0, 1];
%% 3D Translation
T = [1, 0, 0, -10
     0, 1, 0, 5
     0, 0, 1, 4
     0, 0, 0, 1];

%% Projection
P = [1 0 0 0
     0 1 0 0
     0 0 1 0];
 
%% Camera calibration (conversion to pixel coordinates)
f = 500;
ci = 250;
cj = 320;
A = [f 0 ci
     0 f cj
     0 0 1];

%% "Back" projection from large 2D image to 3D space
B = [1 0 0
     0 1 0
     0 0 100
     0 0 1];
