Simple Geometric problem

Python, 200 characters

f=lambda a,b,c,d:min(2,sum((x-c)*(x-d)<=0for x in range(min(a,b),max(a,b)+1)))
for i in' '*input():z=map(int,raw_input().split());print('nothing','point','line',0,'rectangle')[f(*z[::2])*f(*z[1::2])]

f returns:

0 if the intervals [a,b] and [c,d] don't overlap
1 if the intervals [a,b] and [c,d] overlap in only one point
2 if the intervals [a,b] and [c,d] overlap in a range of points

OCaml, 265 chars

let a,c,p=abs,compare,print_endline
let q s t u v w x y z=match
c(a(s-u)+a(w-y))(a(s+u-w-y)),
c(a(t-v)+a(x-z))(a(t+v-x-z))with
0,0->p"point"|0,1|1,0->p"line"|1,1->p"rectangle"|_->p"nothing"
let()=for n=1 to read_int()do Scanf.scanf"%d %d %d %d %d %d %d %d\n"q done

Uses (abuses) the fact that compare returns 0, 1 or -1. This is not guaranteed according to its documentation but true with OCaml 3.10.1.