A closed-form solution to the problem of optimal spacecraft attitude e
stimation based on vector observation, known as the Wahba problem, is
presented. The algorithm first provides the closed-form expressions of
a 4 x 4 matrix eigenvalues and then computes the eigenvector associat
ed with the greatest of them (representing the optimal quaternion) usi
ng two different methods. The first method uses a vector cross-product
in a four-dimensional space, while the second uses an equivalent tech
nique requiring a 3 x 3 nonsingular matrix inversion. The resulting ''
EStimator of the Optimal Quaternion'' (ESOQ) algorithm does not presen
t any singularities and allows an easy identification of the approachi
ng of the unresolvable condition of quasi-parallel observed vectors. N
umerical accuracy tests, showing the average and the variance of the m
aximum attitude errors, are presented. Speed numerical tests, which de
monstrate ESOQ as the fastest optimal attitude estimation algorithm to
date, validate ESOQ as the most suitable algorithm when a fast and op
timal attitude determination is required.