Tangent to a circle equation

382 Views Asked by At

Via desmos

So I wanted to make a program in desmos which shows a tangent to a circle of user defined radius r at the point q (y co ordinate). I've achieved this so far but of course due to negative square roots, etc. I can only have the tangent line be shown in the first quadrant. It dissapears in quadrant two and three, and doesn't work in quadrant four. Can someone please make corrections.

1

There are 1 best solutions below

7
On

Let the circle be given by

$ x^2 + y^2 = r^2 $

A point $(p, q)$ on the circle is parameterized by the angle $\theta$ as follows

$ (p, q) = r (\cos(\theta), \sin(\theta) ) $

The tangent at $(p, q)$ has a unit normal vector equal to $(\cos(\theta),\sin(\theta) )$

Therefore, the equation you want to plot is

$ \cos(\theta) ( x - p) + \sin(\theta)( y - q ) = 0 $

This is shown below for $r = 2.7$ and $\theta = \dfrac{\pi}{3} $

enter image description here