Add RAD2DEG to libs.h
Fix indentation, use atan2 instead of atan