VOOZH about

URL: https://www.geeksforgeeks.org/dsa/equation-of-a-normal-to-a-circle-from-a-given-point/

⇱ Equation of a normal to a Circle from a given point - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Equation of a normal to a Circle from a given point

Last Updated : 23 Jul, 2025

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.

👁 Image

Examples:

Input: a = 4, b = 6, c = 5, x1 = 12, y1 = 14 
Output: y = 1.1x + 0.8

Input: 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:

  • The normal to a circle passes through the center of the circle.
  • Therefore, find the coordinates of the center of the circle (g, f), where g = a/2 and f = b/2.
  • Since the center of the circle and the point where the normal is drawn lie on the normal, calculate the slope of the normal (m) as m = (y1 - f) / (x1 - g). 
  • Hence, the equation of the normal is y - y1 = m * (x - x1).

Below is the implementation of the above approach:


Output: 
y = 1.1x + 0.8

 

Time Complexity: O(1)
Auxiliary Space: O(1)


 

Comment