For tri-ray intersection