Check if a point is inside , outside or on a Hyperbola | Python3 program for the above approach ; Function to check if the point ( x , y ) lies inside , on or outside the given hyperbola ; Stores the value of the equation ; Generate output based on value of p ; Driver Code
from math import pow NEW_LINE def checkpoint ( h , k , x , y , a , b ) : NEW_LINE INDENT p = ( ( pow ( ( x - h ) , 2 ) // pow ( a , 2 ) ) - ( pow ( ( y - k ) , 2 ) // pow ( b , 2 ) ) ) NEW_LINE if ( p > 1 ) : NEW_LINE INDENT print ( " Outside " ) NEW_LINE DEDENT elif ( p == 1 ) : NEW_LINE INDENT print ( " On ▁ the ▁ Hyperbola " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Inside " ) NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT h = 0 NEW_LINE k = 0 NEW_LINE x = 2 NEW_LINE y = 1 NEW_LINE a = 4 NEW_LINE b = 5 NEW_LINE checkpoint ( h , k , x , y , a , b ) NEW_LINE DEDENT