Added C++ cotangent function