The nitrogen in ammonia has 5 valence electrons and bonds with three hydrogen atoms to complete the octet. This would result in the geometry of a regular tetrahedron with each bond angle equal to cos(−) ≈ 109.5°. However, the three hydrogen atoms are repelled by the electron lone pair in a way that the geometry is distorted to a trigonal pyramid (regular 3-sided pyramid) with bond angles of 107°. In contrast, boron trifluoride is flat, adopting a trigonal planar geometry because the boron does not have a lone pair of electrons. In ammonia the trigonal pyramid undergoes rapid nitrogen inversion.