added function of determining orientation of the polygon