## In this article

- 1. The tool
- 2. Introduction
- 3. How does it work?
- 4. Closing remarks & video

## 1. The tool

\(T_2=\)

**CALCULATE**button above to compute the solution for the entered values. The Fig. 1 shows the symbols used in the results.

## 2. Introduction

Recently, I was working with a friend on a problem requiring CFD simulation. To do the simulation, we needed to recreate a geometry from a research paper. It was a simple axi-symmetric geometry, a part of which is shown in Fig. 2.

This is a fully defined geometry and we could have easily created it using a geometric software such as Solidworks or Catia, by applying necessary constraints of tangency. But we were working with Ansys ICEM meshing software. We knew the position of the center of the circle, its radius and the point at which the ramp begun. Here, I have indicated them as point \(O\) and point \(P\) respectively (see Fig. 1 and Fig. 2). If only we knew where the tangent touches the circle (Point \(T\) in Fig. 1), or the angle at which the radial line touches the tangent (angle \(\theta\) in Fig. 1), we could draw the line from point \(P\) to point \(T\).

This problem seems straightforward at first glance, and we thought so as well. But, it is difficult to solve it without an iterative approach. So, I developed a tool written in JavaScript and HTML (see Sec. 1) to do exactly that and provide the solution. I am putting it here, in hope that it would be useful to someone. For technical details on how the tool works continue to read Sec. 3 below.

## 3. How does it work?

A tangent line to a circle has a property that it is perpendicular to the radial line at the point of intersection. That is, line \(OT\) is perpendicular to line \(TP\). Which means that if we represent these lines as vectors, then the dot product of the two vector has to be zero (property of the dot product that is very very important and used way too often). The two vectors are created by joining \(T\)-\(P\) and \(O\)-\(T\). Mathematically, they are obtained by subtracting the coordinates of point \(P\) from point \(T\) and subtracting coordinates of point \(T\) from point \(O\). So we obtain the following vector equation:

Writing it more explicitly, we get,

It is obvious that we can have two solutions to this problem, or no solutions if the point lies inside the circle. The first solution to eq. (6) can be obtained by using the Newton-Raphson method and initializing the iteration such that it converges to one of the sides. The second solution can be similarly obtained. The code decides if there is no solution if it is unable to converge within 100 iterations.

## 4. Closing remarks & video

Interestingly, "Bintang ASWAM" has contributed two different ways of calculating analytical solutions to angles and tangent points. His solutions I have not yet verified his solutions are available at: SolutionsSo now that you know how it works go ahead and use the tool whenever you need it. Feel free to write to me if it is useful or if you find any bugs.

Thanks for using this toolâ€¦ :)

Watch the video below for an animated treat.