Unknown
in CEF I were introduced this quiz in my session, in Mansoura University Faculty of Eng. , when I opening some files on my computer I remember this and I decide to publish it's solution. 
CEF 2010 Quiz Solution


the problem is collision detecting between 2d shapes in 2 levels
-1st level squire in vertical motion and circles in random motion.
2nd level all are in random motion


The prize was a Flash Disk/Digital camera "unfortunately no winners :("

let me assume the more complex problem which in 3d as a sphere/cube instead of circle/square, we need also to know if the sphere touch/ intersect the cube .. all in random motion in Hilbert space ;P

here is the easiest solution "as an Engineer":

project our shapes on the axis x,y and z

if two shapes are not touching/intersecting there exists an axis for which the projection of the shapes will not overlap.

simply we can write our code in 4 if statements in 2d or 6 if statements in 3d  to check the overlapping in each axis.
i.e.:

Cube projection (cx0,cx1), (cy0,cy1) and (cz0,cz1).
Sphere projection (sx0,sx1), (sy0,sy1) and (sz0,sz1).


check overlapping in x axis 
check overlapping in y axis 
check overlapping in z axis 


So never mind ...there is a finite #No. for the entropy in the universe ... also the intelligence is a finite #No.
0 Responses