Attitude determination using vector observations: A fast optimal matrix algorithm