Parallel Parking Mathematics
Author: Jerome A White
Date: December 15, 2009

A demonstration of the mathematics behind the NPR story British Mathematician Perfects Parallel Parking (Dec 15, 2009)
http://www.npr.org/templates/story/story.php?storyId=121453226

Three applications of the Pythagorean Theorem confirm this equation.
Assumptions:
* Center of rotation lies on the same line as the rear axle.
* Curb-to-curb turn radius r is the distance between the center of rotation and the center of the outer front tire's outer wall.
* Protrusion of turned front tires beyond rectangular perimeter of car is negligible.

r: curb-to-curb turning radius

w: width of vehicle in front

r = 35 (slider from 25 to 45, step 1)
d_c = 1 (slider from 0 to 3, step 0.1)
E: (0.0, d_c)
w_0 = 6.1 (slider from 4 to 10, step 0.1)
F: E + (0.0, w_0)
P = Midpoint(E, F)
l = 9.4 (slider from 5 to 15, step 0.1)
r_2: sqrt(r^(2.0) - l^(2.0)) - w_0 / 2.0
O_1: P + (0.0, r_2)
f = Circle(O_1, P)
d = 8 (slider from 0 to 12, step 0.5)
e = Segment((d / 2.0, 0.0), (d / 2.0, y(O_1)))
P_1 = Intersect(f, e)
k = 3.5 (slider from 2 to 5, step 0.1)
w_2: w_0
j = 3 (slider from -5 to 5, step 0.1)
A: (-1.0 * j, d_c)
C: A + (0.0, w_0)
α = Angle(P, O_1, P_1)
B: (l + k, d_c)
D: B + (0.0, w_0)
z = 0.78 (slider from 0 to 1, step 0.01)
z_1: -4.0 * z + 4.0
w_1: w_0
N: (-1.0 * j, 0.0)
Q: N + (-1.0 * j - k - l, 0.0)
w_t = 0.6
G: E + (l, 0.0)
H: F + (l, 0.0)
poly1, a, b, d_0, c = Polygon(A, B, D, C)
J: (l + k + d, w_1)
K: J + (j + k + l, 0.0)
L: (x(J), 0.0)
M: (x(K), 0.0)
poly2, j_1, k_1, m, l_1 = Polygon(J, K, M, L)
poly3, h, i, n, p = Polygon(N, N + (0.0, w_2), Q + (0.0, w_2), Q)
z_2: 4.0 * z - 2.0
s = Segment(G, H)
t = Segment(E, F)
poly4, m_1, q_1, d_1, e_1 = Polygon(M, Q, Q + (0.0, -1.0 * w_1), M + (0.0, -1.0 * w_1))
Δy = -5
h_1 = Segment((x(N), d_c + w_0 / 2.0), (x(A), d_c + w_0 / 2.0))
i_1 = Segment((x(B), d_c + w_0 / 2.0), (x(J), d_c + w_0 / 2.0))
O_2 = Mirror(O_1, P_1)
P_2 = Mirror(P, P_1)
c_1 = CircleArc(O_1, P, P_1)
c_2 = CircleArc(O_2, P_2, P_1)
b_1: y = y(P_2)
O_3 = Mirror(O_2, b_1)
P_3 = Mirror(P_1, b_1)
O_4 = Mirror(O_1, b_1)
P_4 = Mirror(P, b_1)
c_3 = Arc(Mirror[Circle[O_2, P_2], b_1], P_2, P_3)
c_4 = Arc(Mirror[Circle[O_1, P], b_1], P_4, P_3)
A' = Translate(A, Vector[Vector[P, P_2]])
B'_2 = Translate(B, Vector[Vector[P, P_2]])
D'_2 = Translate(D, Vector[Vector[P, P_2]])
C'_2 = Translate(C, Vector[Vector[P, P_2]])
poly1', a', b'_2, d'_2, c'_2 = Polygon(A', B'_2, D'_2, C'_2)
A'_2 = Translate(A, Vector[Vector[P, P_4]])
B'_3 = Translate(B, Vector[Vector[P, P_4]])
D'_3 = Translate(D, Vector[Vector[P, P_4]])
C'_3 = Translate(C, Vector[Vector[P, P_4]])
poly1'_1, a'_2, b'_3, d'_3, c'_3 = Polygon(A'_2, B'_3, D'_3, C'_3)
G' = Translate(G, Vector[Vector[P, P_2]])
H' = Translate(H, Vector[Vector[P, P_2]])
s' = Segment(G', H')
E' = Translate(E, Vector[Vector[P, P_2]])
F' = Translate(F, Vector[Vector[P, P_2]])
t' = Segment(E', F')
G'_1 = Translate(G, Vector[Vector[P, P_4]])
H'_1 = Translate(H, Vector[Vector[P, P_4]])
s'_1 = Segment(G'_1, H'_1)
E'_1 = Translate(E, Vector[Vector[P, P_4]])
F'_1 = Translate(F, Vector[Vector[P, P_4]])
t'_1 = Segment(E'_1, F'_1)
z_3: -4.0 * z + 2.0
z_4: 4.0 * z
θ_1: z_1 * α
θ_2: z_2 * α
θ_3: z_3 * α
θ_4: z_4 * α
A'_1 = Rotate(A, θ_1, O_1)
B' = Rotate(B, θ_1, O_1)
D' = Rotate(D, θ_1, O_1)
C' = Rotate(C, θ_1, O_1)
poly1'_2, a'_1, b', d', c' = Polygon(A'_1, B', D', C')
G'_2 = Rotate(G, θ_1, O_1)
H'_2 = Rotate(H, θ_1, O_1)
s'_2 = Segment(G'_2, H'_2)
E'_2 = Rotate(E, θ_1, O_1)
F'_2 = Rotate(F, θ_1, O_1)
t'_2 = Segment(E'_2, F'_2)
A'' = Rotate(A', θ_2, O_2)
I = Rotate(B'_2, θ_2, O_2)
O = Rotate(D'_2, θ_2, O_2)
R = Rotate(C'_2, θ_2, O_2)
poly1'', a'', i_2, o, r_1 = Polygon(A'', I, O, R)
G'' = Rotate(G', θ_2, O_2)
H'' = Rotate(H', θ_2, O_2)
s'' = Segment(G'', H'')
E'' = Rotate(E', θ_2, O_2)
F'' = Rotate(F', θ_2, O_2)
t'' = Segment(E'', F'')
A''_1 = Rotate(A', -(θ_3), O_3)
S = Rotate(B'_2, -(θ_3), O_3)
T = Rotate(D'_2, -(θ_3), O_3)
U = Rotate(C'_2, -(θ_3), O_3)
poly1''_1, a''_1, s_1, t_1, u = Polygon(A''_1, S, T, U)
G''_1 = Rotate(G', -(θ_3), O_3)
H''_1 = Rotate(H', -(θ_3), O_3)
s''_1 = Segment(G''_1, H''_1)
E''_1 = Rotate(E', -(θ_3), O_3)
F''_1 = Rotate(F', -(θ_3), O_3)
t''_1 = Segment(E''_1, F''_1)
V = Rotate(A'_2, -(θ_4), O_4)
W = Rotate(B'_3, -(θ_4), O_4)
Z = Rotate(D'_3, -(θ_4), O_4)
A_1 = Rotate(C'_3, -(θ_4), O_4)
poly5, v, w, z_5, a_1 = Polygon(V, W, Z, A_1)
B_1 = Rotate(G'_1, -(θ_4), O_4)
C_1 = Rotate(H'_1, -(θ_4), O_4)
g = Segment(B_1, C_1)
D_1 = Rotate(E'_1, -(θ_4), O_4)
E_1 = Rotate(F'_1, -(θ_4), O_4)
q = Segment(D_1, E_1)
P'_1 = Rotate(P, θ_1, O_1)
P'_2 = Rotate(P_2, θ_2, O_2)
P'_3 = Rotate(P_2, -(θ_3), O_3)
P'_4 = Rotate(P_4, -(θ_4), O_4)
f_1 = Segment(A, A'_2)
r4_d = Segment(P'_1, O_1)
r3_d = Segment(P'_2, O_2)
r2_d = Segment(P'_3, O_3)
r1_d = Segment(P'_4, O_4)
α_1 = Angle(P, O_1, P_1)
α_2 = Angle(P_2, O_2, P_1)
α_3 = Angle(P_3, O_3, P_2)
α_4 = Angle(P_3, O_4, P_4)
F_1 = Rotate(G'_1, -(α), O_4)
text2: "horizontal\;displacement\;per\;cycle:\;d_h = 4 r_d - 2 \sqrt{4 r_d²-d²} = " + f_1
text3: "arc\;angle\;swept:\;α = arcsin  \frac{d}{2 r_d} = " + α
text4: "radius\;to\;center\;of\;rear\;axle:\;r_d = \sqrt{ (r²-l²)} -  \frac{ w_0}{2} = " + r1_d