function q = quaternionFromAxisAngle( v )
    angle = norm(v);
    if(angle == 0)
        q = [1 0 0 0]';
    else
        v = v/angle;
        ca2 = cos(angle/2);
        sa2 = sin(angle/2);
        q = [ca2 sa2*v(1) sa2*v(2) sa2*v(3)]';
        q = ns(q);
    end
end

