Given a curve [ y = x(A – x) ], the task is to find normal at given point ( x, y) on that curve, here A is any integer number and x, y also any integer.
Input: A = 2, x = 2, y = 0 Output: 2y = x - 2 Since y = x(2 - x) y = 2x - x^2 differentiate it with respect to x dy/dx = 2 - 2x put x = 2, y = 0 in this equation dy/dx = 2 - 2* 2 = -2 equation => (Y - 0 ) = ((-1/-2))*( Y - 2) => 2y = x -2 Input: A = 3, x = 4, y = 5 Output: Not possible Point is not on that curve
Approach: First we need to find given point is on that curve or not if the point is on that curve then:
- We need to differentiate that equation that point don’t think too much for differentiation of this equation if you analyze then you find that dy/dx always become A – 2x.
- Put x, y in dy/dx.
- Equation of normal is Y – y = -(1/( dy/dx )) * (X – x).
Below is the implementation of the above approach:
2y = x-2
- Find Tangent at a given point on the curve
- Find nth term of the Dragon Curve Sequence
- Program to find Normal and Trace of a matrix
- Find the other end point of a line with given one end and mid
- Program to find the Break Even Point
- Find the Missing Point of Parallelogram
- Program to find the mid-point of a line
- Find if a point lies inside a Circle
- Find mirror image of a point in 2-D plane
- Find a point that lies inside exactly K given squares
- Find the foot of perpendicular of a point in a 3 D plane
- Program to find GCD of floating point numbers
- Find a point such that sum of the Manhattan distances is minimized
- Find the number of points that have atleast 1 point above, below, left or right of it
- Find an Integer point on a line segment with given two ends
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.