# determining the direction of a set of vectors

This topic is 4238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi fellows I've a problem with vectors. I need to compare and to know the directions of a set of vectors that I created dynamically. In my vector creation, I arbitrally define x, y and z coordinate values with little or big variations among the x,y and z vectors values. for example, I have 10 vectors with these values respectivelly: (0.0, -6.5, -11.5) (2.0, -7.8, -8.4) (2.1, -7.7, -6.8) (2.5, -6.8, -5.8) (3.3, -6.6, -3.6) (2.3, -6.6, -3.8) (3.0, -6.0, -4.6) (2.5, -4.0, -5.1) (2.0, -5.5, -6.7) (4.0, -6.7, -7.0) Like you've seen, the z-axis was the axis that have the most variation among the 10 vectors that means the vectors move in the forward and the backward. I need to know what direction the vectors go. Someone can help me in this topic? I don't know if I explain this correctly. Thanks a lot for the support.

##### Share on other sites
I believe this type of problem is known as Principal Components Analysis. A common approach is based on calculating the eigenvectors of the covariance matrix for your input data, and the eigenvector with the largest eigenvalue will point in the direction of most variance of the data set. If you google PCA and eigenvectors/eigenvalues you should find some information that helps. Good luck!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 31
• 16
• 11
• 10
• 12
• ### Forum Statistics

• Total Topics
634118
• Total Posts
3015602
×