code: private void crossSegmentShadowLine(
              int shadowx, int shadowy,
              int sx0, int sy0,
              int sx1, int sy1,
              boolean isMax) {
          if (shadowy < sy0 && shadowy < sy1) {
              // Segment is entirely at the top of the shadow line
              return;
          }
          if (shadowy > sy0 && shadowy > sy1) {
              // Segment is entirely at the bottom of the shadow line
              return;
          }
          if (shadowx > sx0 && shadowx > sx1) {
              // Segment is entirely at the left of the shadow line
              return;
          }
          // Compute the intersection point between the segment and the shadow line
          final int xintercept = (int) Math.round((double) sx0 + (shadowy - sy0) * (sx1 - sx0) / (sy1 - sy0));
          if (shadowx > xintercept) {
              // The intersection point is on the left of the shadow line.
              return;
          }
          if (isMax) {
              setCrossingCoordinateForYMax(xintercept, shadowy);
          } else {
              setCrossingCoordinateForYMin(xintercept, shadowy);
          }
          if (sy0 < sy1) {
              ++this.crossings;
          } else {
              --this.crossings;
          }
      }
docs: Determine where the segment is crossing the shadow line.
  
  @param shadowx x coordinate of the reference point of the shadow line.
  @param shadowy y coordinate of the reference point of the shadow line.
  @param sx0 x coordinate of the first point of the segment.
  @param sy0 y coordinate of the first point of the segment.
  @param sx1 x coordinate of the second point of the segment.
  @param sy1 y coordinate of the second point of the segment.
  @param isMax <code>true</code> if the shadow line is for ymax; <code>false</code> if it is for
  ymin.
  @param data the data to update.