calculate angle to use