Converted getAngle from inline