# How to find equation of a circle tangential to two straight lines?

The image given above has two lines, AB and AC that are tangential to the circle with radius r. Points y1,y2 and the slope m of line AB are known. The graph represents a linear increase of speed (y axis) with respect to time (x axis). In-order to have a smooth transition of speed, edges of the line AB are curved using arc of a circle with radius r, as shown in the image. such that the circle is tangential to line AB and AC.

The unknowns values Width(to find the shift in time) and Height(to stop the curving) has to be found in-order to curve the edges of the line AB so that it appears like a spline. How can I find these values?

• Perpendicular distance from these lines is equal radius, and you can use the general equation of a tangent to a circle? Jun 21, 2020 at 17:14
• stackoverflow.com/a/51235277/3871028 Jun 21, 2020 at 17:14
• @Ripi2 if Y1=10,Y2 =50, x1 = 0;x2 = 40. R = 4. Can I solve this problem with these many known values using the solution in link? Jun 21, 2020 at 20:11
• @ArunJoeCheriyan Why not? Try it. Jun 21, 2020 at 22:49
• @Ripi2 I tried substituting the values , but the result are out of range. The points A is common to line AC and AB here and tangent point to line AC is point that is back in time. Jun 22, 2020 at 7:16

Hint:

Let $$\angle BAC=\alpha$$. Then the width $$w$$ and the height $$h$$ can be computed as: $$w=r\tan\frac\alpha2=r\sqrt\frac{1-\cos\alpha}{1+\cos\alpha};\quad h=w\sin\alpha.$$

Let the slope of tangent be $$2 \phi$$ and let

$$T= \frac{y_2-y_1}{x_2-x_1}=\tan 2 \phi,\text{find} \cos 2 \phi;$$

Solving quadratic equation for $$t= \tan \phi$$,

$$T= \frac{2t}{1-t^2},\; t=\frac{\sqrt{1+T^2}-1}{T}$$

Line between the cutting point and circle center is bisector to the double right angled quadrilateral.

$$W= r \; t, H= r (1- \cos 2 \phi).$$