I need to define a cube and three intervals Cx, Cy, and Cz as the projections of the cuboid on the x-, y-, and z-axes, respectively. I'm supposed to use the interval predicate interval_dur
. The image on the link may more clear what i need indeed.
The original question goes like this:
We can define three-dimensional qualitative spatial relations between cuboids such as inside and on top of by considering the qualitative relations between their projections on each axis. Figure 1 shows cuboid
C
with interval projections on the x-, y-, and z-axes. (a) Define a cuboidC
. Define three intervalsCx
,Cy
, andCz
as the projections of the cuboid on the x-, y-, and z-axes, respectively. Use the interval predicateinterval_dur
.
My understanding of the question: you need to create a predicate interval_dur(C, Cx, Cy, Cz) such that "cuboid" C and intervals Cx, Cy, Cz are related in a specified way.
"C" can be specified using three points, so the whole predicate could be something like this:
interval_dur(C, Cx, Cy, Cz) :-
C = ((X1, Y1, Z1), (X2, Y2, _Z2), (_X3, _Y3, Z3)),
Cx = (X1, X2),
Cy = (Y1, Y2),
Cz = (Z1, Z3).
This formulation assumes that points in C are in a specific order: the most close bottom left first, etc. This can be improved using sorting.