Modeling and computing ternary projective relations between regions