:: : : : : : : : : You can avoid special cases by working in projective coordinates, which have the nice property that if P and Q are points, the line containing them is P�Q ( the cross product ), and if L and M are lines, their point of intersection is L�M . So if A, B, C, D are the corners in circular order, the center point is ( A�C ) ?( B�D ) and the line U = 0.5 ( or V = 0.5 ) is ( ( A�C ) ?( B�D ) ) ?( ( A�B ) ?( C�D ) ).