interior point check algorithm | ScratchStats