Class SchwarzChristoffelMapping

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

    public class SchwarzChristoffelMapping
    extends AlgorithmBase
    implements java.awt.event.MouseListener
    • Field Detail

      • tolerance

        private double tolerance
      • eps

        private double eps
      • accessLock

        private final java.util.concurrent.locks.Lock accessLock
      • canProcessMouseClick

        private final java.util.concurrent.locks.Condition canProcessMouseClick
      • xClick

        private int xClick
      • yClick

        private int yClick
      • w

        private double[][] w
      • linhx

        java.util.Vector<java.lang.Double>[][] linhx
      • linhy

        java.util.Vector<java.lang.Double>[][] linhy
      • xSource

        private double[] xSource
      • ySource

        private double[] ySource
      • corners

        private int[] corners
      • CROSSRATIO_POLYGON_TO_CIRCLE

        private final int CROSSRATIO_POLYGON_TO_CIRCLE
        See Also:
        Constant Field Values
      • POLYGON_EXTERIOR_TO_CIRCLE

        private final int POLYGON_EXTERIOR_TO_CIRCLE
        See Also:
        Constant Field Values
      • CROSSRATIO_POLYGON_TO_RECTANGLE

        private final int CROSSRATIO_POLYGON_TO_RECTANGLE
        See Also:
        Constant Field Values
      • algorithm

        private int algorithm
      • setCenter

        private boolean setCenter
      • xCenter

        private double xCenter
      • yCenter

        private double yCenter
      • crsplit_neww

        private double[][] crsplit_neww
      • crsplit_orig

        private boolean[] crsplit_orig
      • crtriang_edge

        private int[][] crtriang_edge
      • crtriang_triedge

        private int[][] crtriang_triedge
      • crtriang_edgetri

        private int[][] crtriang_edgetri
      • crparam_beta

        private double[] crparam_beta
      • crparam_cr

        private double[] crparam_cr
      • crparam_qdata

        private double[][] crparam_qdata
      • craffine_aff

        private double[][][] craffine_aff
      • craffine_wn

        private double[][] craffine_wn
      • crfixwc_quadnum

        private int crfixwc_quadnum
      • crfixwc_mt

        private double[][] crfixwc_mt
      • crfixwc

        private double[] crfixwc
      • testRoutine

        private boolean testRoutine
      • exterRoutine

        private boolean exterRoutine
    • Constructor Detail

      • SchwarzChristoffelMapping

        public SchwarzChristoffelMapping()
      • SchwarzChristoffelMapping

        public SchwarzChristoffelMapping​(ModelImage destImg,
                                         ModelImage srcImg,
                                         double[][] w)
      • SchwarzChristoffelMapping

        public SchwarzChristoffelMapping​(ModelImage destImg,
                                         ModelImage srcImg,
                                         double[] xSource,
                                         double[] ySource,
                                         int algorithm,
                                         boolean setCenter,
                                         double xCenter,
                                         double yCenter)
      • SchwarzChristoffelMapping

        public SchwarzChristoffelMapping​(ModelImage destImg,
                                         ModelImage srcImg,
                                         double[] xSource,
                                         double[] ySource,
                                         int[] corners,
                                         int algorithm)
    • Method Detail

      • runAlgorithm

        public void runAlgorithm()
        Description copied from class: AlgorithmBase
        Actually runs the algorithm. Implemented by inheriting algorithms.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • setEps

        public void setEps​(double eps)
      • runPolygonToCircle

        public void runPolygonToCircle()
      • runCrossRatioPolygonToCircle

        public void runCrossRatioPolygonToCircle()
      • runPolygonExteriorToCircle

        public void runPolygonExteriorToCircle()
      • runPolygonToRectangle

        public void runPolygonToRectangle()
      • runCrossRatioPolygonToRectangle

        public void runCrossRatioPolygonToRectangle()
      • testRectmap1

        public void testRectmap1()
      • testRectmap2

        public void testRectmap2()
      • testRectmap3

        public void testRectmap3()
      • testDiskmap1

        public void testDiskmap1()
      • testDiskmap2

        public void testDiskmap2()
      • testDiskmap3

        public void testDiskmap3()
      • testDiskmap4

        public void testDiskmap4()
      • testDiskmap5

        public void testDiskmap5()
      • testDiskmap6

        public void testDiskmap6()
      • testDiskmap7

        public void testDiskmap7()
      • testCRDiskmap1

        public void testCRDiskmap1()
      • testCRDiskmap2

        public void testCRDiskmap2()
      • testCRDiskmap3

        public void testCRDiskmap3()
      • testCRDiskmap5

        public void testCRDiskmap5()
      • testCRDiskmap7

        public void testCRDiskmap7()
      • testExtermap1

        private void testExtermap1()
      • testExtermap2

        private void testExtermap2()
      • testCRRectmap1

        public void testCRRectmap1()
      • testCRRectmap2

        public void testCRRectmap2()
      • testCRRectmap3

        public void testCRRectmap3()
      • crparam

        public void crparam​(double[][] w,
                            double[] beta,
                            double[][] cr0,
                            double tol)
      • crsplit

        private void crsplit​(double[][] w)
      • crpsgd

        private void crpsgd​(double[] d1,
                            double[] d2,
                            double[][] segment,
                            double[][] pts1,
                            double[][] pts2)
      • crtriang

        private void crtriang​(double[][] w)
      • crpsdist

        private double[] crpsdist​(double[][] segment,
                                  double[][] pts)
      • crcdt

        private void crcdt​(double[][] w)
      • crqgraph

        private void crqgraph​(double[][] w)
      • crimap0

        private double[][] crimap0​(double[][] wp,
                                   double[][] z,
                                   double[] beta,
                                   double[][] aff,
                                   double[][] qdat,
                                   boolean ode,
                                   boolean newton,
                                   double tol,
                                   int maxiter)
      • crmap0

        private double[][] crmap0​(double[][] zp,
                                  double[][] z,
                                  double[] beta,
                                  double[][] aff,
                                  double[][] qdat)
      • exteriorevalinv

        private double[][] exteriorevalinv​(SchwarzChristoffelMapping.scmap M,
                                           double[][] wp,
                                           double[][] tol,
                                           double[][] z0,
                                           int maxiter)
      • diskevalinv

        private int[] diskevalinv​(double[][] zp,
                                  SchwarzChristoffelMapping.scmap M,
                                  double[][] wp,
                                  double[][] tol,
                                  double[][] z0,
                                  int maxiter)
      • crinvmap

        private double[][] crinvmap​(double[][] wp,
                                    double[][] w,
                                    double[] beta,
                                    double[] cr,
                                    double[][][] aff,
                                    int quadnum,
                                    double[][] mt,
                                    SchwarzChristoffelMapping.qlgraph Q,
                                    double[][] qdat,
                                    boolean ode,
                                    boolean newton,
                                    double tol,
                                    int maxiter)
      • rinvmap

        private double[][] rinvmap​(double[][] wp,
                                   double[][] w,
                                   double[] beta,
                                   double[][] z,
                                   double[] c,
                                   double[] L,
                                   double[][] qdat,
                                   double[][] z0,
                                   boolean ode,
                                   boolean newton,
                                   double tol,
                                   int maxiter)
      • rectproject

        private double[][] rectproject​(double[][] zp,
                                       double[] rect)
      • rderiv

        private double[][] rderiv​(double[][] zp,
                                  double[][] z,
                                  double[] beta,
                                  double[] c,
                                  double[] L,
                                  double[][] zs)
      • deinvmap

        private double[][] deinvmap​(double[][] wp,
                                    double[][] w,
                                    double[] beta,
                                    double[][] z,
                                    double[] c,
                                    double[][] qdat,
                                    double[][] z0,
                                    boolean ode,
                                    boolean newton,
                                    double tol,
                                    int maxiter)
      • dinvmap

        private int[] dinvmap​(double[][] zp,
                              double[][] wp,
                              double[][] w,
                              double[] beta,
                              double[][] z,
                              double[] c,
                              double[][] qdat,
                              double[][] z0,
                              boolean ode,
                              boolean newton,
                              double tol,
                              int maxiter)
      • dederiv

        private double[][] dederiv​(double[][] zp,
                                   double[][] z,
                                   double[] beta,
                                   double[] c)
      • dderiv

        private double[][] dderiv​(double[][] zp,
                                  double[][] z,
                                  double[] beta,
                                  double[] c)
      • scimapz0

        public void scimapz0​(double[][] z0,
                             double[][] w0,
                             java.lang.String prefix,
                             double[][] wp,
                             double[][] w,
                             double[] beta,
                             double[][] z,
                             double[] c,
                             double[][] qdat,
                             double[][] aux)
      • hpmap

        public void hpmap​(double[][] wp,
                          double[][] zp,
                          double[][] w,
                          double[] beta,
                          double[][] z,
                          double[] c,
                          double[][] qdat)
      • hpquad

        public double[][] hpquad​(double[][] z1,
                                 double[][] z2,
                                 int[] sing1,
                                 double[][] z,
                                 double[] beta,
                                 double[][] qdat)
      • stmap

        public double[][] stmap​(double[][] zp,
                                double[][] w,
                                double[] beta,
                                double[][] z,
                                double[] c,
                                double[][] qdat)
      • demap

        private double[][] demap​(double[][] zp,
                                 double[][] w,
                                 double[] beta,
                                 double[][] z,
                                 double[] c,
                                 double[][] qdat)
      • dmap

        private double[][] dmap​(double[][] zp,
                                double[][] w,
                                double[] beta,
                                double[][] z,
                                double[] c,
                                double[][] qdat)
      • crrect

        public void crrect​(double[][] wr,
                           double[][][] affr,
                           double[][] w,
                           double[] beta,
                           double[] cr,
                           double[][][] aff,
                           SchwarzChristoffelMapping.qlgraph Q,
                           double[] betar,
                           double tol)
      • crdiskplot

        public void crdiskplot​(SchwarzChristoffelMapping.scmap M,
                               double[] R,
                               double[] theta,
                               int num1draw,
                               int num2draw,
                               boolean drawThetaToRadiusOne,
                               double[] error,
                               int yInvert)
      • exterplot

        public void exterplot​(SchwarzChristoffelMapping.scmap M,
                              double[] R,
                              double[] theta,
                              int num1draw,
                              int num2draw,
                              double[] error,
                              int yInvert,
                              double[] axis)
      • diskplot

        public void diskplot​(SchwarzChristoffelMapping.scmap M,
                             double[] R,
                             double[] theta,
                             int num1draw,
                             int num2draw,
                             double[] error,
                             int yInvert)
      • crplot

        private void crplot​(double[][] w,
                            double[] beta,
                            double[] cr,
                            double[][][] aff,
                            int quadnum,
                            double[][] mt,
                            SchwarzChristoffelMapping.qlgraph Q,
                            double[] R,
                            double[] theta,
                            int nqpts,
                            int num1draw,
                            int num2draw,
                            boolean drawThetaToRadiusOne,
                            int yInvert)
      • crmap

        private double[][] crmap​(double[][] zp,
                                 double[][] w,
                                 double[] beta,
                                 double[] cr,
                                 double[][][] aff,
                                 int quadnum,
                                 double[][] mt,
                                 SchwarzChristoffelMapping.qlgraph Q,
                                 double[][] qdat)
      • moebius

        private double[][] moebius​(double[][] z,
                                   double[][] w)
      • deplot

        private void deplot​(double[][] w,
                            double[] beta,
                            double[][] z,
                            double[] c,
                            double[] R,
                            double[] theta,
                            int nqpts,
                            int num1draw,
                            int num2draw,
                            int yInvert,
                            double[] axis)
      • dplot

        private void dplot​(double[][] w,
                           double[] beta,
                           double[][] z,
                           double[] c,
                           double[] R,
                           double[] theta,
                           int nqpts,
                           int num1draw,
                           int num2draw,
                           int yInvert)
      • crrplot

        public void crrplot​(double[][] w,
                            double[] beta,
                            double[][] wr,
                            double[] betar,
                            double[] cr,
                            double[][][] aff,
                            double[][][] affr,
                            SchwarzChristoffelMapping.qlgraph Q,
                            double[] re,
                            double[] im,
                            int yInvert)
      • crrplot0

        private void crrplot0​(java.lang.String direcn,
                              double[] val,
                              double minlen,
                              double maxlen,
                              int maxrefn,
                              double tol,
                              double[][] w,
                              double[] beta,
                              double[][] wr,
                              double[] betar,
                              double[] cr,
                              double[][][] aff,
                              double[][][] affr,
                              SchwarzChristoffelMapping.qlgraph Q,
                              double[][] qdat,
                              double[][] qdatr,
                              double[] axlim,
                              double siz,
                              java.util.Vector<java.lang.Double>[][] linhx,
                              java.util.Vector<java.lang.Double>[][] linhy)
      • crrsort

        private void crrsort​(java.util.Vector<java.lang.Double>[] wpReal,
                             java.util.Vector<java.lang.Double>[] wpImag,
                             int[][] qnum,
                             SchwarzChristoffelMapping.qlgraph Q)
      • crrmap

        public void crrmap​(double[][][] wp,
                           int[][] qnum,
                           double[][] zp,
                           double[][] w,
                           double[] beta,
                           double[][] wr,
                           double[] betar,
                           double[] cr,
                           double[][][] aff,
                           double[][][] affr,
                           SchwarzChristoffelMapping.qlgraph Q,
                           double[][] qdat,
                           double[][] qdatr)
      • rplot

        private void rplot​(double[][] w,
                           double[] beta,
                           double[][] z,
                           double[] c,
                           double[] L,
                           int re,
                           int im,
                           int yInvert)
      • scpadapt

        public void scpadapt​(java.util.Vector<java.lang.Double> zpReal,
                             java.util.Vector<java.lang.Double> zpImag,
                             java.util.Vector<java.lang.Double> wpReal,
                             java.util.Vector<java.lang.Double> wpImag,
                             java.util.Vector<java.lang.Boolean> newlog,
                             double minlen,
                             double maxlen,
                             double[] clip)
      • scpadapt2

        private double[][][] scpadapt2​(java.util.Vector<java.lang.Double> zpReal,
                                       java.util.Vector<java.lang.Double> zpImag,
                                       java.util.Vector<java.lang.Double>[] wpReal,
                                       java.util.Vector<java.lang.Double>[] wpImag,
                                       java.util.Vector<java.lang.Boolean> newlog,
                                       double minlen,
                                       double maxlen,
                                       double[] clip)
      • rmap

        private void rmap​(double[][] wp,
                          double[][] zp,
                          double[][] w,
                          double[] beta,
                          double[][] z,
                          double[] c,
                          double[] L,
                          double[][] qdat)
      • stmap

        private void stmap​(double[][] wp,
                           double[][] zp,
                           double[][] w,
                           double[] beta,
                           double[][] z,
                           double[] c,
                           double[][] qdat)
      • plotpoly

        public ViewJFrameGraph plotpoly​(float[] xPointArray,
                                        float[] yPointArray,
                                        double[][] w,
                                        double[] beta,
                                        boolean addMarkerLabel,
                                        double[] axlim,
                                        int yInvert,
                                        boolean closed,
                                        double[] axis)
      • rcorners

        private void rcorners​(double[][] w,
                              double[] beta,
                              double[][] z,
                              int[] corners,
                              int[] renum)
      • angle

        public void angle​(double[] alpha,
                          boolean[] isccw,
                          int[] index,
                          double[][] w,
                          double[] angle)
      • isinpoly

        private void isinpoly​(boolean[] indexout,
                              boolean[][] onvtx,
                              double[][] z,
                              double[][] w,
                              double[] beta,
                              double tol)
      • isinpoly2

        private void isinpoly2​(int[] indexout,
                               boolean[][] onvtx,
                               double[][] z,
                               double[][] w,
                               double[] beta,
                               double tol)
      • scangle

        private double[] scangle​(double[][] w)
      • deparam

        private void deparam​(double[][] z,
                             double[] c,
                             double[][] qdat,
                             double[][] w,
                             double[] beta,
                             double[][] z0,
                             double tol)
      • dparam

        private void dparam​(double[][] z,
                            double[] c,
                            double[][] qdat,
                            double[][] w,
                            double[] beta,
                            double[][] z0,
                            double tol)
      • rparam

        private void rparam​(double[][] z,
                            double[] c,
                            double[] L,
                            double[][] qdat,
                            double[][] w,
                            double[] beta,
                            int[] cnr,
                            double[][] z0,
                            double tol)
      • scselect

        public int[] scselect​(double[][] w,
                              double[] beta,
                              int m,
                              java.lang.String titl,
                              java.lang.String[] msg)
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent mouseEvent)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent event)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent event)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent event)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent event)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • r2strip

        private void r2strip​(double[][] yp,
                             double[][] yprime,
                             double[][] zp,
                             double[][] z,
                             double L)
      • ellipjc

        private void ellipjc​(double[][] sn,
                             double[][] cn,
                             double[][] dn,
                             double[][] u,
                             double L,
                             boolean flag)
      • ellipkkp

        private void ellipkkp​(double[] K,
                              double[] Kp,
                              double L)
      • printExitStatus

        public void printExitStatus​(int exitStatus)
      • dequad

        private double[][] dequad​(double[][] z1,
                                  double[][] z2,
                                  int[] sing1,
                                  double[][] z,
                                  double[] beta,
                                  double[][] qdat)
      • dquad

        private double[][] dquad​(double[][] z1,
                                 double[][] z2,
                                 int[] sing1,
                                 double[][] z,
                                 double[] beta,
                                 double[][] qdat)
      • dabsquad

        private double[][] dabsquad​(double[][] z1,
                                    double[][] z2,
                                    int[] sing1,
                                    double[][] z,
                                    double[] beta,
                                    double[][] qdat)
      • crquad

        private double[][] crquad​(double[][] z1,
                                  int[] sing1,
                                  double[][] z,
                                  double[] beta,
                                  double[][] qdat)
      • zdiv

        public void zdiv​(double ar,
                         double ai,
                         double br,
                         double bi,
                         double[] cr,
                         double[] ci)
        complex divide c = a/b.
        Parameters:
        ar - double
        ai - double
        br - double
        bi - double
        cr - double[]
        ci - double[]
      • zabs

        public double zabs​(double zr,
                           double zi)
        zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.
        Parameters:
        zr - double
        zi - double
        Returns:
        double
      • zmlt

        public void zmlt​(double ar,
                         double ai,
                         double br,
                         double bi,
                         double[] cr,
                         double[] ci)
        complex multiply c = a * b.
        Parameters:
        ar - double
        ai - double
        br - double
        bi - double
        cr - double[]
        ci - double[]
      • stquadh

        public double[][] stquadh​(double[][] z1,
                                  double[][] z2,
                                  int[] sing1,
                                  double[][] z,
                                  double[] beta,
                                  double[][] qdat)
      • stquad

        public double[][] stquad​(double[][] z1,
                                 double[][] z2,
                                 int[] sing1,
                                 double[][] z,
                                 double[] beta,
                                 double[][] qdat)
      • stderiv

        public double[][] stderiv​(double[][] zp,
                                  double[][] z,
                                  double[] beta,
                                  double[] c,
                                  int j)
      • sign

        public double sign​(double d)
      • sign

        private double[] sign​(double dReal,
                              double dImag)
      • rptrnsfm

        private void rptrnsfm​(double[][] z,
                              double[] y,
                              int[] cnr)
      • scqdata

        public void scqdata​(double[][] qdat,
                            double[] beta,
                            int nqpts)
      • gaussj

        private void gaussj​(double[] z,
                            double[] w,
                            int n,
                            double alf,
                            double bet)
      • sccheck

        public int sccheck​(java.lang.String type,
                           double[][] w,
                           double[] beta,
                           int[] aux)
      • scfix

        public void scfix​(double[][] wn,
                          double[] betan,
                          int[] verticesAdded,
                          int[] auxn,
                          java.lang.String type,
                          double[][] w,
                          double[] beta,
                          int[] aux)
      • scaddvtx

        private void scaddvtx​(double[][] wn,
                              double[] betan,
                              double[][] w,
                              double[] beta,
                              int pos,
                              double[] window)
      • isFinite

        private static final boolean isFinite​(double d)