Closest distance beetwen clothoid and given point I need formulas which let me compute closest distance beetwen given point and clothoid ("normal" to clothoid).
I have given point: P(x,y) and Clothoid parameters: BeginnigClothoid(x,y), EndClothoid(x,y), R (radius), A parmeter (clothoid parameter).
 A: Let the parametric equation of the curve be $x=x(t),y=y(t)$. You need to minimize the (squared) Euclidean distance,
$$d^2=(X-x(t))^2+(Y-y(t))^2.$$
This is otained by canceling the first derivative on $t$,
$$\frac12\frac{d}{dt}d^2=(X-x(t))x'(t)+(Y-y(t))y'(t).$$
In the case of the Clothoid, this is a pretty difficult transcendental equation.
By studying the asymptotic behavior for large $t$, we can establish that the curve tends to hyperbolic spirals  around the two convergence points, and can be approximated by concentric circles. This can give reasonable starting points for iterative methods. I would recommend to try several starting points on neighboring circles to make sure to converge to the right arc.
Farther from the convergence points, it is probably reasonable to approximate the curve with a few line segments and project the given point onto them. This can give one or two starting points (in the overlap areas).

A: The clothoid or Euler spiral or Cornu spiral can be defined as
$$\vec{c}(L) = \begin{cases}x(L) = \frac{1}{a} \int_0^L \cos(t^2) d\,t \\
y(L) = \frac{1}{a} \int_0^L \sin(t^2) d\,t \end{cases}$$
or, equivalently, as a power series,
$$\vec{c}(L) = \begin{cases}x(L) = \frac{1}{a} \sum_{i=0}^{\infty} \frac{(-1)^i}{(2 i)!}\frac{L^{4 i + 1}}{4 i + 1} \\
y(L) = \frac{1}{a} \sum_{i=0}^{\infty} \frac{(-1)^i}{(2 i + 1)!}\frac{L^{4 i + 3}}{4 i + 3} \end{cases}$$
and its tangent is
$$\vec{d}(L) = \frac{d\,\vec{c}(L)}{d\;L} = \begin{cases}\frac{d\,x(L)}{d\,L} = \frac{\cos(L^2)}{a} \\
\frac{d\,y(L)}{d\,L} = \frac{\sin(L^2)}{a} \end{cases}$$
The points $\vec{p}$ perpendicular to the spiral fulfill
$$\left ( \vec{p} - \vec{c}(L) \right ) \cdot \vec{d}(L) = 0$$
so one way would be to solve this for $L$, possibly leading to multiple values of $L \in R$, $L \gt 0$.
Another way is to find $L$ where the squared distance from point $\vec{p}$ to point $\vec{c}(L)$ reaches a minimum:
$$\min \left\lvert \vec{p} - \vec{c}(L) \right\rvert^2$$
In both cases, you need $\vec{c}(L)$, whose components are Fresnel integrals (which, as shown above, can also be described as infinite power series).
Because of this, I do not believe there are any algebraic solutions to this. (Even if there were, I suspect they would be basically unmanageably complex.)
This leaves us with numerical solutions.
The attractor for the spiral is at
$$\lim_{L=\infty} \vec{c}(L) = \left ( \frac{\sqrt{\pi}}{2 a \sqrt{2}}, \frac{\sqrt{\pi}}{2 a \sqrt{2}} \right )$$
Points near the attractor may be between the spiral passes, so one probably should take extra care there.
The power series yields an interesting option for finding the numerical solution: you can truncate the evaluation of the series early, based on either the squared distance divided by $a$ squared, or by the direction and length of the vector element iterations $i$ and $i+1$ add to $\vec{c}(L)/a$:
$$\begin{cases}
\frac{x_n(L)}{a} = \frac{L^{4 i + 1}}{(2 i)! \; (4 i + 1)} - \frac{L^{4 i + 2}}{(2 i + 2)! \; (4 i + 5)} \\
\frac{y_n(L)}{a} = \frac{L^{4 i + 1}}{(2 i + 1)! \; (4 i + 3)} - \frac{L^{4 i + 4}}{(2 i + 2)! \; (4 i + 7)} \end{cases}$$
Here is one algorithm for finding the $L \in \mathbb{R}$, $L \ge 0$, that globally minimizes the distance between $\vec{c}(L)$ and point $\vec{p}$:
Find two or three consecutive (in $L$) local distance minima for the squared distance to point $\vec{p}$. If the one with the smallest or middle $L$ has the smallest distance, then it is the solution; otherwise, you need to find the next local minima with a larger $L$, until you find the true minimum.
This should work, because if the point is near the initial part of the spiral, the first local distance minimum is the global distance minimum. If $\vec{p}$ is well outside the spiral attractor, the second local minima is the global distance minimum. Otherwise, $\vec{p}$ is inbetween spiral passes near the attractor, and you need to bracket $\vec{p}$.
Also note that it is easy to split $L$ into sections where $x(L)$ or $y(L)$ is monotonic, allowing for very fast binary searches. This is due to
$$\frac{d \, x(L)}{d\,L} = 0 \iff L = \sqrt{n \pi + \frac{\pi}{2}}$$
and
$$\frac{d \, y(L)}{d\,L} = 0 \iff L = \sqrt{n \pi}$$
where $n \in \mathbb{Z}$. In other words, if $n$ is some integer, range $L = \sqrt{n \pi / 2} .. \sqrt{(n + 1) \pi / 2}$ is one quadrant (one quarter turn) of the Euler spiral. In each such range there can be at most one local minimum in distance to some point $\vec{p}$. (Note that the distance squared is not a monotonic function; but since it only has one minimum in each range, you can still use a fast binary search in distance squared to find the local minimum in each range.)
I do suspect OP is not interested in numerical solutions, but it just strikes me (stroke me?) how realizing the geometric features allows for an efficient approach for numerical solutions. (By this I mean that understanding the geometric interpretation allows for short-circuiting the evaluation of the power series, but also an efficient overall approach for the global minimum distance search that avoids the issues normally associated with finding minima/maxima when dealing with a periodic function.)
