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
function checkpoint ( h , k , x , y , a , b ) { var p = ( parseInt ( Math . pow ( ( x - h ) , 2 ) ) / parseInt ( Math . pow ( a , 2 ) ) ) + ( parseInt ( Math . pow ( ( y - k ) , 2 ) ) / parseInt ( Math . pow ( b , 2 ) ) ) ; return p ; } var h = 0 , k = 0 , x = 2 , y = 1 , a = 4 , b = 5 ; if ( checkpoint ( h , k , x , y , a , b ) > 1 ) document . write ( " " ) ; else if ( checkpoint ( h , k , x , y , a , b ) == 1 ) document . write ( " " ) ; else document . write ( " " ) ;