Package com.itextpdf.layout.minmaxwidth
Class RotationMinMaxWidth.WidthFunction
- java.lang.Object
-
- com.itextpdf.layout.minmaxwidth.RotationMinMaxWidth.WidthFunction
-
- Enclosing class:
- RotationMinMaxWidth
private static class RotationMinMaxWidth.WidthFunction extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RotationMinMaxWidth.WidthFunction.Interval
-
Constructor Summary
Constructors Constructor Description WidthFunction(double angle, double area)
Create new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getRotatedHeight(double x)
Function used for height calculations of rotated element.double
getRotatedWidth(double x)
Function used for width calculations of rotated element.RotationMinMaxWidth.WidthFunction.Interval
getValidOriginalWidths(double availableWidth)
Get's possible values of NOT rotated width of all element that have therer rotated width less that availableWidthdouble
getWidthDerivativeZeroPoint()
Gets the argument ofgetRotatedWidth(double)
that results in zero derivative.
-
-
-
Method Detail
-
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 ofgetRotatedWidth(double)
that results in zero derivative. In case we haveRotationMinMaxWidth.sin(double)
== 0
orRotationMinMaxWidth.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
-
-