# Calculating circle radius from two points and arc length

For a simulation I want to convert between different kind of set point profiles with one being set points based on steering angles and one being based on circle radius.

I have 2 way points the steering angle the distance driven and now I need to approximate or calculate a circle radius where the arc length equals the distance between the waypoints.

Is this kind of problem solvable or is there no solution but incremental calculations.

Please see the Image i attached as link. I marked the things that I have blue, the things that I need red. Dotted are the things I don't really need.

Image problem explanation

similar problem

another similar problem

-
I found a partial solution to determine the outer circle Partial Solution Image But how to go about getting the inner one to determine the correct arc length. –  Hendrik May 1 '13 at 22:13
What do you mean by “steering angle”? I'd assume that that angle would aöready imply a circle radius, so your problem might be solvable from that quantity alone. You could also compute the radius from the arc and chord length, ignoring the steering angle. –  MvG May 2 '13 at 4:13
@MvG: The steering angle is the angle of the wheels relative to the current moving direction. (or the angle of the steering wheel) This angle is marked as alpha in the first image, its not possible to draw a circle from this point since the car is on the street. The origin of the circle/curve i need is always under/the side of the street (offset by the radius i need to determine) –  Hendrik May 2 '13 at 7:49
In a car with Ackermann steering, the angle between the wheels and the vehicle axis is usually not the same for both wheels. But once you have the positions of all wheels relative to one another, you can compute the radius of the turning circle. You can base this on the fact that, disregarding toe, the directions of all wheels will be tangential to a circle around a single point, which is the centre of the turning circle. –  MvG May 2 '13 at 9:29

Ignoring this “steering angle”, you have two relevant quantities: the distance between points, which is equal to the chord length $c$, and the arc length $a$. You're looking for a radius $r$ and an angle $\theta$ such that

\begin{align*} a &= r\theta \\ c &= 2r\sin\frac\theta2 \end{align*}

This results in a transcendental equation for $\theta$:

$$c\theta=2a\sin\frac\theta2$$

I guess that a numeric solution (perhaps some form of gradient descent) is most likely the best option to solve this. I don't know any special function to solve this equation. Once you have $\theta$, you can compute

$$r=\frac a\theta$$

-
I think you are partial right there are multiple solutions to this problem (one being an infinite radius where the arc length would be equal to the distance). I found also a possible solution, maybe I'll go from that solution in incremental steps from both sides to find a more correct one. Maybe you could have a look at my possible solution (your θ is beta in my image) –  Hendrik May 2 '13 at 8:01

You can calculate by taking all the circonference through your two points and then imposing that the tangent at the second point is equal to $\sin(\alpha)$ (depending on how you set your axis) so that you have three costraints on your equation

In my reference (origin on the straight wheel, $y$-axis towards the steering wheel) the result is $$R = \frac{L}{2}\cdot\sqrt{1+\frac{9}{\sin^2(\alpha)}}$$

-

I found at least one possible solution where the result doesn't got through both waypoints but at least has the correct "distance" arc length. It makes use of versine to get the angle at the center and then the arc length calculation to get a radius which produces one possible solution for the arc length given.

I would appreciate it if maybe a alternate or even better a more accurate solution, that would go through both waypoints is found.

Possible Solution

-
I suspect it might be a impossible to find a more acurate solution since when radius is increased or decreased the waypoint isn't on the circle anymore. Additionally the origin of the circle is locked in its x position. So thats as good as it gets (one can either decide for both waypoints on the circle or the correct distance travelled) –  Hendrik May 2 '13 at 8:14
Your use of $\alpha$ is quite confusing. The steering of a car affects the curvature of its path. For constant steering this means the radius of its turn circle. Your $\alpha$ seems to be related to the direction between the two way points. Which doesn't make a lot of sense in real life scenarios. I didn't follow the rest of your computation after that, since I believe this one problem makes the rest mostly irrelevant. –  MvG May 2 '13 at 9:42
We are talking here about a series of measurements with little intervals and this series of measurements would represent a curved line. If the interval is too large it wont represent a real life scenario, but one has to work with what one gets ;( –  Hendrik May 2 '13 at 9:49
Still if the intervals are small enough it probably wont matter much since as you said the steering angle is more or less an approximation if one doesn't know the exact steering setup of the car. –  Hendrik May 2 '13 at 9:55