Calculation of nonlinear optical polarization and phase matching in biaxial crystals