http://www.blackpawn.com/texts/pointinpoly/default.html
This website provides 2 simple methods to do so. You just have to use cross product for the 1st case. Hope it can help you.
@Cruikshank
I used your approach, that is power series expansion, and proved the statement.
Please refer to this question:
http://www.voofie.com/content/102/how-to-prove-eab-e-lambda2-ea-eb/" [Broken]
and this article is my prove...
Just the gradient of the potential matters
Please refer to the below formula:
\vec{F} = - \nabla V
Therefore we are just interested in the negative gradient of the potential, not it's sign.