A solution to spacecraft position and attitude determination from an imaged ellipsoid