code: public static Geometry computeShadow(Geometry geometry, double azimuth, double altitude, double height, boolean doUnion) {
          if (geometry == null) {
              return null;
          }
          if (height <= 0) {
              throw new IllegalArgumentException("The height of the geometry must be greater than 0.");
          }
          //Compute the shadow offset
          double[] shadowOffSet = shadowOffset(azimuth, altitude, height);
          if (geometry instanceof Polygon) {
              return shadowPolygon((Polygon) geometry, shadowOffSet, geometry.getFactory(), doUnion);
          } else if (geometry instanceof LineString) {
              return shadowLine((LineString) geometry, shadowOffSet, geometry.getFactory(), doUnion);
          } else if (geometry instanceof Point) {
              return shadowPoint((Point) geometry, shadowOffSet, geometry.getFactory());
          } else {
              throw new IllegalArgumentException("The shadow function supports only single geometry POINT, LINE or POLYGON.");
          }
      }
docs: Compute the shadow footprint based on
  
  @param geometry input geometry
  @param azimuth of the sun in radians
  @param altitude of the sun in radians
  @param height of the geometry
  @param doUnion unified or not the polygon shadows
  @return