Lemma.
$$
\left| e^{i\,\alpha} - e^{i\,\beta} \right|^2 = \\
\left| \; \left[ \cos(\alpha) + i\,\sin(\alpha)\right] - \left[\cos(\beta) + i\,\sin(\beta) \right] \; \right|^2 = \\
\left[ \cos(\alpha) - \cos(\beta) \right]^2 + \left[ \sin(\alpha) - \sin(\beta) \right]^2 = \\
\cos^2(\alpha) - 2\cos(\alpha)\cos(\beta) + \cos^2(\beta) +
\sin^2(\alpha) - 2\sin(\alpha)\sin(\beta) + \sin^2(\beta) = \\
2 - 2\cos(\alpha-\beta)
$$
Least Squares Method. Two possibilities:
$$
\left| e^{i(\theta+2\pi/3)} - e^{i12\theta} \right|^2 +
\left| e^{i(\theta-2\pi/3)} - e^{i720\theta} \right|^2 = \mbox{minimum}(\theta) \\
\left| e^{i(\theta-2\pi/3)} - e^{i12\theta} \right|^2 +
\left| e^{i(\theta+2\pi/3)} - e^{i720\theta} \right|^2 = \mbox{minimum}(\theta)
$$
Whatever minimum is the smallest. With the lemma:
$$
2 - 2\cos(\theta+2\pi/3-12\theta) + 2 - 2\cos(\theta-2\pi/3-720\theta) = \mbox{minimum}(\theta) \\
2 - 2\cos(\theta-2\pi/3-12\theta) + 2 - 2\cos(\theta+2\pi/3-720\theta) = \mbox{minimum}(\theta)
$$
Brute force algorithm with sampling $\Delta\theta = 2\pi/(60\times 720)$ :
program klok;
function minimum(theta : double; teken : integer) : double;
begin
minimum := 2 - 2*cos(theta+teken*2*pi/3-12*theta)
+ 2 - 2*cos(theta-teken*2*pi/3-720*theta);
end;
function normal(theta : double) : double;
var
OK : boolean;
v : double;
begin
v := theta;
OK := false;
while not OK do
begin
OK := (0 <= v) and (v < 2*pi);
v := v - 2*pi;
end;
normal := v + 2*pi;
end;
procedure brute_force(teken : integer);
var
k : integer;
M,min,p,w : double;
begin
min := 8; w := 0;
for k := 0 to 43200-1 do
begin
p := k*2*pi/43200;
M := minimum(p,teken);
if min > M then
begin
w := p;
min := M;
end;
end;
Writeln('Minimum =',min);
Writeln('H =',w,' <',w+2*pi/43200);
Writeln('M =',normal(12*w),' =',w+teken*2*pi/3);
Writeln('S =',normal(720*w),' =',w-teken*2*pi/3);
Writeln;
end;
begin
brute_force(+1);
brute_force(-1);
end.
Output (in radians):
Minimum = 1.32888417836478E-0004
H = 3.04690854166910E+0000 < 3.04705398577343E+0000
M = 5.14697596413128E+0000 = 5.14130364406230E+0000
S = 9.42477796078314E-0001 = 9.52513439275905E-0001
Minimum = 1.32888417839328E-0004
H = 3.23627676551049E+0000 < 3.23642220961482E+0000
M = 1.13620934304831E+0000 = 1.14188166311729E+0000
S = 5.34070751109978E+0000 = 5.33067186790368E+0000
Differentiation of the minimum functions, resulting in two equations:
$$
11\sin(11\theta-2\pi/3) + 719\sin(719\theta+2\pi/3) = 0 \\
11\sin(11\theta+2\pi/3) + 719\sin(719\theta-2\pi/3) = 0
$$
Solving these with MAPLE, resulting in numerical refinement of the above:
Digits := 50;
fsolve(11*sin(11*theta-2*Pi/3)+719*sin(719*theta+2*Pi/3)=0,theta=3.0469..3.0470);
fsolve(11*sin(11*theta+2*Pi/3)+719*sin(719*theta-2*Pi/3)=0,theta=3.2362..3.2364);
Giving (Hours hand in radians):
3.0469223755142191756046177765785671073381009266460
3.2362629316653673013206689899804386610562378721043
Don't know which one of the two is the best. It looks like the minima are exactly the same, namely:
0.0000339325557414428099817512048046050292710528311