This version is old school.
Please find jQuery plugins on npm.
whichTriangle.js
by Mudit Ameta
A small jQuery plugin that helps you divide an element into four triangles and test co-ordinates on them.