My professor was deriving the parallel axis theorem wherein he took the Center of mass of an object as some point O and was calculating the moment of inertia about an axis through point P located at a distance d from O. I consider a point i with infinitesimal dimensions located at a distance r from P ( given by vector $\vec r$ ) and distance $r_i$ from O ( given by vector $\vec r_i$ ).
\begin{align} I_p=\sum_i m_i r^2 &= \sum_i m_i (\vec d+ \vec r_i)(\vec d+ \vec r_i) \\ &= d^2\sum_i m_i + \sum_i m_i r_i^2 + 2d \sum_i m_i r_i= d^2\sum_i m_i + I_{cm} + 2\vec d \sum_i m_i \vec r_i \end{align}
According to my professor $\sum_i m_i \vec r_i$ vanishes because $\sum_i m_i \vec r_i$ can be written as $(\frac{\sum_i m_i \vec r_i}{M}) \times M$ and $\frac{\sum_i m_i \vec r_i}{M} =0 $ because this is the center of mass in a co-ordinate system with center of mass as the origin and hence is zero I do not understand this. Maybe because I do not have complete grip over the concept of center of mass.