Class 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.
    • Field Detail

      • sin

        private double sin
      • cos

        private double cos
      • area

        private double area
    • Constructor Detail

      • WidthFunction

        public WidthFunction​(double angle,
                             double area)
        Create new instance
        Parameters:
        angle - rotation angle in radians
        area - the constant area
    • 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.