Class RotationMinMaxWidth.WidthFunction

java.lang.Object
com.itextpdf.layout.minmaxwidth.RotationMinMaxWidth.WidthFunction
Enclosing class:
RotationMinMaxWidth

private static class RotationMinMaxWidth.WidthFunction extends Object
Class that represents functions used, for calculation of width of element after rotation based on it's NOT rotated width and assumption, that area of element stays the same when we try to layout it with different available width. Contains handy methods for function analysis.
  • Field Details

    • sin

      private double sin
    • cos

      private double cos
    • area

      private double area
  • Constructor Details

    • WidthFunction

      public WidthFunction(double angle, double area)
      Create new instance
      Parameters:
      angle - rotation angle in radians
      area - the constant area
  • Method Details

    • getRotatedWidth

      public double getRotatedWidth(double x)
      Function used for width calculations of rotated element. This function is continuous on interval: (0, Infinity)
      Parameters:
      x - width value of NOT rotated element
      Returns:
      width of rotated element
    • getRotatedHeight

      public double getRotatedHeight(double x)
      Function used for height calculations of rotated element. This function is continuous on interval: (0, Infinity)
      Parameters:
      x - width value of NOT rotated element
      Returns:
      width of rotated element
    • getValidOriginalWidths

      public RotationMinMaxWidth.WidthFunction.Interval getValidOriginalWidths(double availableWidth)
      Get's possible values of NOT rotated width of all element that have therer rotated width less that availableWidth
      Parameters:
      availableWidth - the highest possible width of rotated element.
      Returns:
      interval that specify biggest and smallest possible values of NOT rotated width of such elements.
    • getWidthDerivativeZeroPoint

      public double getWidthDerivativeZeroPoint()
      Gets the argument of getRotatedWidth(double) that results in zero derivative. In case we have RotationMinMaxWidth.sin(double)== 0 or RotationMinMaxWidth.sin(double)== 0 the function doesn't have zero derivative on defined interval, but value returned by this method fits well in the calculations above.
      Returns:
      the argument of getRotatedWidth(double) that results in zero derivative