2nd Quadrant
For an angle θ in the second quadrant the reference angle φ is the remaining angle needed to complete a straight angle, that is, π radians or 180°. Thus θ + φ = π or θ + φ = 180°, and so
φ = π - θ or φ = 180° - θ.

3rd Quadrant
For an angle θ in the third quadrant the reference angle φ is the angle that must be subtracted from θ to leave a straight angle, that is, π radians or 180°. Thus θ - φ = π or θ - φ = 180°, and so
φ = θ - π or φ = θ - 180°

4th Quadrant
For an angle θ in the fourth quadrant the reference angle φ is the remaining angle needed to complete a full circle angle, that is, 2π radians or 360°. Thus θ + φ = 2π or θ + φ = 360°, and so
φ = 2π - θ or φ = 360° - θ.
