Use formula d=∣(a−p)×b∣∣b∣d = \frac{|(\mathbf{a} - \mathbf{p}) \times \mathbf{b}|}{|\mathbf{b}|}d=∣b∣∣(a−p)×b∣.