Package com.itextpdf.layout.minmaxwidth
Class RotationMinMaxWidth.WidthFunction
java.lang.Object
com.itextpdf.layout.minmaxwidth.RotationMinMaxWidth.WidthFunction
- Enclosing class:
RotationMinMaxWidth
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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getRotatedHeight
(double x) Function used for height calculations of rotated element.double
getRotatedWidth
(double x) Function used for width calculations of rotated element.getValidOriginalWidths
(double availableWidth) Get's possible values of NOT rotated width of all element that have therer rotated width less that availableWidthdouble
Gets the argument ofgetRotatedWidth(double)
that results in zero derivative.
-
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 radiansarea
- 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
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
-