function main
% Calls Rodrigues' Formula
clear all
clc

v = [1;2;3];
theta = 75/180*pi;

R = Rodrigues(v, theta)

end % function main

% MATLAB RESPONSE
% R =
%    -1.5752   -1.1019    1.5930
%     1.8943   -0.9809    0.6892
%    -0.4044    1.6879    0.0096


function R = Rodrigues(v, theta)
% given a scalar and a vector, the function normalizes the vector and
% implements Rodriues' Formula

v_bar = sqrt(norm(v,2));

v_norm =  1/v_bar*v;

v_scew = [     0         -v_norm(3)      v_norm(2);...
            v_norm(3)        0          -v_norm(1);...
           -v_norm(2)     v_norm(1)          0     ];

 
R = eye(3) + v_scew*sin(theta) + (v_scew)^2*(1-cos(theta));

end % function Rodrigues

