php class to calculate the crossfoot and the crossproduct