Find Tangent at a given point on the curve | function for find Tangent ; differentiate given equation ; check that point on the curve or not ; if differentiate is negative ; differentiate is positive ; differentiate is zero ; declare variable ; call function findTangent
function findTangent ( A , x , y ) { var dif = A - x * 2 ; if ( y == ( 2 * x - x * x ) ) { if ( dif < 0 ) document . write ( " " + dif + " " + ( x * dif + y ) + " " ) ; else if ( dif > 0 ) document . write ( " " + dif + " " + - x * dif + y + " " ) ; else document . write ( " " + " " ) ; } } var A = 2 , x = 2 , y = 0 ; findTangent ( A , x , y ) ;