Count of obtuse angles in a circle with ' k ' equidistant points between 2 given points | PHP program to count number of obtuse angles for given two points . ; There are two arcs connecting a and b . Let us count points on both arcs . ; Both arcs have same number of points ; Points on smaller arc is answer ; Driver code
< ? php function countObtuseAngles ( $ a , $ b , $ k ) { $ c1 = ( $ b - $ a ) - 1 ; $ c2 = ( $ k - $ b ) + ( $ a - 1 ) ; if ( $ c1 == $ c2 ) return 0 ; return min ( $ c1 , $ c2 ) ; } $ k = 6 ; $ a = 1 ; $ b = 3 ; echo countObtuseAngles ( $ a , $ b , $ k ) ; ? >