Check if a point is inside , outside or on the parabola | Java Program to check if the point lies within the parabola or not ; Function to check the point ; checking the equation of parabola with the given point ; driver code
class solution { static int checkpoint ( int h , int k , int x , int y , int a ) { int p = ( int ) Math . pow ( ( y - k ) , 2 ) - 4 * a * ( x - h ) ; return p ; } public static void main ( String arr [ ] ) { int h = 0 , k = 0 , x = 2 , y = 1 , a = 4 ; if ( checkpoint ( h , k , x , y , a ) > 0 ) System . out . println ( " Outside " ) ; else if ( checkpoint ( h , k , x , y , a ) == 0 ) System . out . println ( " On ▁ the ▁ parabola " ) ; else System . out . println ( " Inside " ) ; } }