calculating end angle

calculating end angle