Check if a point is inside , outside or on the ellipse | Function to check the point ; checking the equation of ellipse with the given point ; Driver code
< ? php function checkpoint ( $ h , $ k , $ x , $ y , $ a , $ b ) { $ p = ( pow ( ( $ x - $ h ) , 2 ) / pow ( $ a , 2 ) ) + ( pow ( ( $ y - $ k ) , 2 ) / pow ( $ b , 2 ) ) ; return $ p ; } $ h = 0 ; $ k = 0 ; $ x = 2 ; $ y = 1 ; $ a = 4 ; $ b = 5 ; if ( checkpoint ( $ h , $ k , $ x , $ y , $ a , $ b ) > 1 ) echo ( " Outside " ) ; else if ( checkpoint ( $ h , $ k , $ x , $ y , $ a , $ b ) == 1 ) echo ( " On ▁ the ▁ ellipse " ) ; else echo ( " Inside " ) ; ? >