created function for triangle intersection