![]() |
VOOZH | about |
Given three integers a, b, c representing coefficients of the equation x2 + y2 + ax + by + c = 0 of a circle, the task is to find the equation of the normal to the circle from a given point (x1, y1).
Note: Normal is a line perpendicular to the tangent at the point of contact between the tangent and the curve.
Examples:
Input: a = 4, b = 6, c = 5, x1 = 12, y1 = 14
Output: y = 1.1x + 0.8Input: a = 6, b = 12, c = 5, x1 = 9, y1 = 3
Output: y = -0.5x + 7.5
Approach: Follow the steps below to solve the problem:
Below is the implementation of the above approach:
y = 1.1x + 0.8
Time Complexity: O(1)
Auxiliary Space: O(1)