I have a state that represents a direction vector condtrained to the surface of a unit sphere . In the update step of a Kalman filter, the state estimate is the sum of two values, like this
$$\hat{x_{k|k}}=\hat{x_{k|k-1}}+K_k(z_k-\hat{z_k})$$
This takes the latest predicted value that happens to meet the constraint, and updates it with a weighted difference between the measurement and the expected value of the measurement.
In my case, the state, x, is in $\Bbb{R}^3$, but I would like to consider this in other dimensions.
My question is how do I perform the update so that the result is constrained to the surface (in this case a sphere)? How is the performance of the filter degraded by this? Any reference material or direct help would be useful to me in dealing with this question.