A vector \( \vec{a} \) has components \( 3p \) and \( 1 \) with respect to a rectangular cartesian system. This system is rotated through a certain angle about the origin in the counter clockwise sense. If, with respect to new system, \( \vec{a} \) has components \( p + 1 \) and \( \sqrt{10} \), then a value of \( p \) is equal to: