/* * cvhharea.c Jim Piper 11-09-86 * * Compute area under "convex semi-hull of histogram" object * (which is in fact an open polygon). To make this area more * nearly comparable with the histogram integral, notional zero-height points * one unit to the left and right of the convex hull are assumed. */ #include #include cvhharea (cvhh) struct object *cvhh; { register int i,cvhhar; register struct polygondomain *cvhpdom; register struct ivertex *vtx, *wtx; cvhpdom = (struct polygondomain *) cvhh->idom; vtx = cvhpdom->vtx; wtx = vtx+1; cvhhar = vtx->vtY; for (i=1; invertices; i++,vtx++,wtx++) cvhhar += (wtx->vtX-vtx->vtX) * (wtx->vtY+vtx->vtY); cvhhar += vtx->vtY; return(cvhhar/2); }