This is plabv.c in view mode; [Download] [Up]
#include "plplot.h" /* Determines if point (px,py) lies above the line joining (sx1,sy1) to */ /* (sx2,sy2). It only works correctly if sx1 <= px <= sx2 */ int plabv(px, py, sx1, sy1, sx2, sy2) int px, py, sx1, sy1, sx2, sy2; { int above; if (py >= sy1 && py >= sy2) above = 1; else if (py < sy1 && py < sy2) above = 0; else if ((double)(sx2-sx1) * (py-sy1) > (double)(px-sx1) * (sy2-sy1)) above = 1; else above = 0; return((int)above); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.