I am working on some data which are 3D in dimensions. Using the PCA, I found the eigenvectors and eigenvalues which gives the direction of data spread. Sorry my maths is quite poor.

I want to plot the 3 planes (for visualization) that gives the 3 direction of the data spread for my report. I am using C++ thats why I cant use any plotting tools like matlab so I am writing my own.

How can I get the equation of the planes from the eigenvectors? The eigenvectors are direction so is it the normals of the plane? Equation of form Ax+by+cz+d = 0, what is will be the d value.


If what you are talking about are principal planes and you would like to find that out. Let $\pmb{R} \in \mathbb{R}^{3 \times 3}$ be your covariance matrix and call $\pmb{v}_1$, $\pmb{v}_2$, and $\pmb{v}_3$ the eigenvectors, then the plane normal to $\pmb{v}_k$ is \begin{equation} \pmb{v}_k^{\text{T}} \begin{bmatrix} x - x_0\\ y - y_0\\ z - z_0 \end{bmatrix} = 0 \end{equation} where $(x_0,y_0,z_0)$ is a point on the plane. These values determine the $d$ you are talking about.

  • $\begingroup$ [x,y,z] are the original points? $\endgroup$ – user1965914 Aug 30 '16 at 13:33
  • 1
    $\begingroup$ [x,y,z] are the variables in your equation $Ax + by + cz + d = 0 $ $\endgroup$ – Ahmad Bazzi Aug 30 '16 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.