Find if it 's possible to rotate the page by an angle or not. | function to find if it 's possible to rotate page or not ; Calculating distance b / w points ; If distance is not equal ; If the points are in same line ; Points a , b , and c
< ? php function possibleOrNot ( $ a1 , $ a2 , $ b1 , $ b2 , $ c1 , $ c2 ) { $ dis1 = pow ( $ b1 - $ a1 , 2 ) + pow ( $ b2 - $ a2 , 2 ) ; $ dis2 = pow ( $ c1 - $ b1 , 2 ) + pow ( $ c2 - $ b2 , 2 ) ; if ( $ dis1 != $ dis2 ) echo " No " ; else if ( $ b1 == ( ( $ a1 + $ c1 ) / 2.0 ) && $ b2 == ( ( $ a2 + $ c2 ) / 2.0 ) ) echo " No " ; else echo " Yes " ; } $ a1 = 1 ; $ a2 = 0 ; $ b1 = 2 ; $ b2 = 0 ; $ c1 = 3 ; $ c2 = 0 ; possibleOrNot ( $ a1 , $ a2 , $ b1 , $ b2 , $ c1 , $ c2 ) ; ? >