caliculate hessian, FO with two direction