Find points on internally tangent circle

I'm working on an algorithm to allow a vehicle to reverse and then line up and stop on a given spot facing a specific direction. The best approach I've been able to come up with involves two internally tangent circles with the larger extending from the point of tangency of the vehicle.

Vehicle starts at point A and is parallel with tangent line T. Vehicle reverses to B, then moves forward to C, then to A so that it is parallel with the vector displayed instead. r represents the minimum turning radius of the vehicle

Given that line AC is always arranged vertically and knowing point A, but that the tangent line T can vary, is it possible to be able to determine points B and C? If not what other info is needed?

Medium tangent

Steep tangent

Shallow tangent

For simplicity I've made it so that the radius of the larger circle is twice the radius of the smaller. If this restriction is not required to solve the problem how could this larger radius be determined as well?

• What are the starting and ending points of the maneuver? What is $T$ ? Commented Aug 17, 2023 at 8:42
• Does it reverse from A to B and then move forward to C at a different steering angle? Commented Aug 17, 2023 at 12:51
• Also, why are the two circles necessarily have radii $r$ and $2r$. Why cant the smaller circle have some other radius and still be tangent? In fact, it could be an exterior tangent too, right? Commented Aug 17, 2023 at 12:53
• Starting point is A and is parallel with tangent line T. Vehicle reverses to B, then moves forward to C, then A so that it is parallel with the vector displayed instead r represents the minimum turning radius Commented Aug 17, 2023 at 14:55

Assuming that we know the location of $$A$$ and the reversing direction (i.e., $$\theta$$) of the vehicle at the start of the mentioned parking manoeuvre, we first try to obtain three expressions that determine the position of $$B$$ and $$C$$. We also denote the radii of the arcs traced by reversing and moving forward by $$r_\text{1}$$ and $$r_\text{2}$$ respectively. The mentioned arcs have their respective centers at $$O_1$$ and $$O_2$$ (see $$\mathrm{Fig.\space 1}$$). Let $$\measuredangle PO_1O_2 =\phi$$.

Consider the right-angled triangle $$O_2PO_1$$. $$O_2P=O_1Q-O_2C=r_1\cos\left(\theta\right)-r_2 \quad\rightarrow\quad \sin\left(\phi\right)=\dfrac{O_2P}{O_1O_2}=\dfrac{r_1\cos\left(\theta\right)-r_2}{r_1-r_2} \tag{1}$$ $$O_1P=\sqrt{r_1^2\sin^2\left(\theta\right)+2r_1r_2\left(\cos\left(\theta\right) - 1\right)}$$

Therefore, $$h_C=AQ+QC=AQ+O_1P=r_1\sin\left(\theta\right)+ \sqrt{r_1^2\sin^2\left(\theta\right)+2r_1r_2\left(\cos\left(\theta\right) - 1\right)},\enspace \tag{2}$$ $$h_B =AQ+r_1\cos\left(\phi\right)=r_1\left(\sin\left(\theta\right)+\dfrac{\sqrt{r_1^2\sin^2\left(\theta\right)+2r_1r_2\left(\cos\left(\theta\right) - 1\right)}}{r_1-r_2}\right), \space\text{and}\tag{3}$$ $$w_B=O_2C-O_2B\sin\left(\phi\right)=\dfrac{r_1r_2}{r_1-r_2}\left(\cos\left(\theta\right)-1\right).\qquad\qquad\qquad\qquad\qquad\qquad\enspace \tag{4}$$

As you can see, we were able to express horizontal and vertical distances from $$A$$ to $$B$$ and $$C$$ in terms of $$r_1$$, $$r_2$$, and $$\theta$$. This shows us that we must know both radii $$r_1$$ and $$r_2$$ to determine the positions of $$B$$ and $$C$$. There is no other way out.

If you are reluctant to fix the value of $$r_1$$, you could give the value of $$\angle PO_1O_2$$ instead. This restricts the driver of the vehicle how far he\she could back up before starting to move forward though. If you agree to this option, you can calculate $$r_1$$ using (1), i.e., $$r_1=\left(\dfrac{1-\sin\left(\phi\right)}{\cos\left(\theta\right)- \sin\left(\phi\right)}\right)r_2.$$

Or you could specify $$w_B$$ and ask to find $$r_1$$, $$h_B$$, and $$h_C$$. The equation required for determining $$r_1$$ follows from (4). $$r_1=\dfrac{r_2w_B}{w_B-\left(1-\cos\left(\theta\right)\right)r_2},\quad\text{where}\quad w_B\gt \left(1-\cos\left(\theta\right)\right)r_2$$

Let the direction vector of the tangent line be $$\mathbf{d} = (\cos \theta, \sin \theta)$$, then the normal vector pointing "downward" is $$\mathbf{n} = (\sin \theta, - \cos \theta)$$. Take a certain value of $$r$$, and compute the center of the big circle as follows:

$$\mathbf{O} = \mathbf{A} + 2 r \mathbf{n}$$

Assume that point $$\mathbf{C}$$ is "below" point $$\mathbf{A}$$ and such that $$\overline{\mathbf{AC}} = x \gt 0$$, then the coordinates of $$\mathbf{C}$$ are

$$\mathbf{C} = \mathbf{A} + (- x, 0 )$$

And the center of the small circle is

$$\mathbf{O'} = \mathbf{C} + (0, r ) = \mathbf{A} + (-x, r)$$

Now now from the description of the problem, we want the distance $$\overline{\mathbf{OO'}} = r$$

This gives a quadratic equation in $$x$$ which has two possible solutions.

Explicitly, the equation is

$$x^2 - 4 r x \cos \theta + 4 r^2 (1 - \sin \theta ) = 0$$

And its solutions $$x$$ are determined by the quadratic formula.

To calculate $$\mathbf{B}$$, define the vector

$$\mathbf{v} = \mathbf{O'} - \mathbf{O}$$

Then

$$\mathbf{B} = \mathbf{O'} + \mathbf{v} = 2 \mathbf{O'} - \mathbf{O}$$

The two figures show the two possible solutions for $$\theta = \dfrac{\pi}{4}$$, and $$r = 5$$.

From $$A$$ we have two directions represented by the two unitary vectors $$\hat v= (v_x,v_y)$$ and $$\hat w=(w_x,w_y)$$ as starting and ending respectively. The geometric elements needed to construct the required maneuver are:

$$\cases{ L_e\to p = A+\lambda\hat v\\ L_s\to p = A + \mu \hat w\\ C_e\to \|p-O_e\|^2 = R^2\\ C_i\to \|p-O_i\|^2 = r^2 }$$

where $$p = (x,y)$$. Calling now $$\hat v_o = (v_y,-v_x)$$ we have

$$\cases{ O_e = A + R\hat v_o\\ \{B\} = C_e\cap C_i\\ \{C\} = C_i\cap L_s }$$

The determination of $$O_i$$ and $$C$$ is made at the same time. From $$\{C\} = C_i\cap L_s$$ we have

$$\|A+\mu\hat w-O_i\|^2=\|A-O_i\|^2-2\mu(A-O_i)\cdot\hat w+\mu^2=r^2$$

and solving for $$\mu$$ we have

$$\mu = (A-O_i)\cdot\hat w\pm\sqrt{((A-O_i)\cdot\hat w)^2-\|A-O_i\|^2+r^2}$$

and at tangency we have

$$\cases{ ((A-O_i)\cdot\hat w)^2-\|A-O_i\|^2+r^2=0\\ \mu^* = (A-O_i)\cdot\hat w }$$

then solving for $$O_i$$

$$\cases{ ((A-O_i)\cdot\hat w)^2-\|A-O_i\|^2+r^2=0\\ \|A+R\hat v_0-O_i\| = r^2 }$$

we obtain two solutions for $$O_i$$. Also $$C,B$$ are determined as

$$\cases{ C = A +\mu^* \hat w \\ B = O_e+2(O_i-O_e) }$$

Follows a graphic showing in blue the centers for $$O_e, {O_i}_1, {O_i}_2$$ in red the points $$B_1,B_2,C_1,C_2$$ and in black $$A$$. Note that $$\hat w$$ is not necessarily vertical. The adopted values are

$$\cases{ A = (0,0)\\ R = 2\\ r = 1\\ \hat v =(\frac{1}{\sqrt{3}},\frac{3}{\sqrt{3}})\\ \hat w =(-\frac{1}{\sqrt{5}} ,\frac{2}{\sqrt{5}}) }$$

Follows a MATHEMATICA script to perform the calculations

parms = {vx -> 1, vy -> 3, wx -> -0.5, wy -> 1, r -> 1, R -> 2, ax -> 0, ay -> 0};
v = {vx, vy}/Sqrt[vx^2 + vy^2];
vo = {v[[2]], -v[[1]]};
w = {wx, wy}/Sqrt[wx^2 + wy^2];
pA = {ax, ay};
pC = pA + lambda  w;
oi = {oxi, oyi};
oe = pA + R vo;
equoi1 = ((pA - oi).w)^2 - ((pA - oi).(pA - oi) - r^2);
equoi2 = (oi - oe).(oi - oe) - r^2;
equsoi = {equoi1, equoi2} /. parms;
soloi = Quiet@Solve[equsoi == 0, oi, Reals];
lambda0 = -(pA - oi).w;
pB1 = oe + 2 (oi - oe) /. soloi[[1]] /. parms;
pB2 = oe + 2 (oi - oe) /. soloi[[2]] /. parms;
pC1 = pA + lambda0 w /. soloi[[1]] /. parms;
pC2 = pA + lambda0 w /. soloi[[2]] /. parms;

• Are you able to simplify your results and add labels to your diagram. I'm afraid I don't follow any of your solution Commented Aug 18, 2023 at 20:59