Class AlgorithmCircularSectorToRectangle

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmCircularSectorToRectangle
    extends AlgorithmBase
    This software uses 2D conformal mapping in converting a circular sector defined by 4 user points at the sector corners to a rectangle of user specified size. The circular sector has an inner radius rmin, an outer radius rmax, and extends over an angle theta = alpha * PI radians, with 0 Let z4z1 be on the real axis, let the straight line z2z3 be inclined at an angle alpha*PI, 0 1 and 0

    To go from a circular sector to a rectangle use the transformation w = f(z) = u + iv = log(z)/(i*alpha*PI) Let z = r*exp(i*theta) Then, w = log(r*exp(i*theta))/(i*alpha*PI) = theta/(alpha*PI) - i*log(r)/(alpha*PI) so u = theta/(alpha*PI), v = -log(r)/(alpha*PI)

    For conformal mapping we require that f(z) be analytic - the Cauchy-Riemann equations must be satisfied and f'(z) must not equal zero. The Cauchy-Riemann equations in polar form are: du/dr = (1/r)(dv/dtheta); (1/r)du/dtheta = -dv/dr The first equation gives zero on both sides and the second equation gives (alpha*PI)/r on both sides, so the Cauchy Riemann equations hold. f'(z) = 1/(i*alpha*PI*z) does not equal zero.

    In the first mapping: rmin -> sqrt(rmin/rmax) -> log(sqrt(rmin/rmax))/(i*alpha*PI) = i*log(sqrt(rmax/rmin))/(alpha*PI) rmin*exp(i*alpha*PI) -> sqrt(rmin/rmax)*exp(i*alpha*PI) -> 1 + i*log(sqrt(rmax/rmin))/(alpha*PI) rmax -> sqrt(rmax/rmin) -> log(sqrt(rmax/rmin))/(i*alpha*PI) = -i*log(sqrt(rmax/rmin))/(alpha*PI) rmax*exp(i*alpha*PI) -> sqrt(rmax/rmin)*exp(i*alpha*PI) -> 1 - i*log(sqrt(rmax/rmin))/(alpha*PI)

    Now do a simple linear transformation where both the x axis is inverted and both axes are scaled to obtain: z1" = xDim-1, 0 z2" = 0, 0 z3" = 0, yDim-1 z4" = xDim - 1, yDim-1

    x" = (1 - x')*(xDim - 1) Let var = log(sqrt(rmax/rmin))/(alpha*PI) y" = (y' + var)* (yDim - 1)/(2 * var)

    A similar transformation is performed in Conformal Mapping by Zeev Nehari Chapter VI Mapping Properties of Special Functions 2. Exponential and Trigonometric Functios pp. 273-280. Nehari states that "the transformation w = exp(z) maps the boundary of any rectangle in the z-plane whose sides are parallel to the axes onto a closed contour consisting of two circular arcs about the origin and two linear segments pointing at the origin."

    References: 1.) Advanced Calculus For Applications Second Edition by F. B. Hildebrand, Section 10.4 Analytic Functions of a Complex Variable pages 550-554 and Section 11.4 Conformal Mapping pages 628-632, Prentice-Hall, Inc., 1976. 2.) "A Domain Decomposition Method for Conformal Mapping onto a Rectangle", N. Papamichael and N. S. Stylianopoulos, Constructive Approximation, Vol. 7, 1991, pp. 349-379. Relevant result is given in Remark 4.7 on pages 374-375.

    3.) Conformal Mapping by Zeev Nehari Chapter VI Mapping Properties of Special Functions 2. Exponential and Trigonometric Functions pp. 273-280.
    • Constructor Detail

      • AlgorithmCircularSectorToRectangle

        public AlgorithmCircularSectorToRectangle()
        AlgorithmCircularSectorToRectangle - default constructor.
      • AlgorithmCircularSectorToRectangle

        public AlgorithmCircularSectorToRectangle​(ModelImage destImg,
                                                  ModelImage srcImg,
                                                  double[] x,
                                                  double[] y)
        AlgorithmCircularSectorToRectangle.
        Parameters:
        destImg - DOCUMENT ME!
        srcImg - DOCUMENT ME!
        x - array with x coordinates of 4 sector boundary points
        y - array with y coordinates of 4 sector boundary points
    • Method Detail

      • selfTest

        private void selfTest()
      • selfTest2

        private void selfTest2()
      • selfTest3

        private void selfTest3()