Complex bakeoff - example 3

Harry H. Cheng uunet!dragon.engr.ucdavis.edu!chengh
Thu Oct 12 05:45:24 PDT 1995


> > // To generate points along streamlines ...
> > 
> > void main()
> > {
> >         double_complex z;
> >         int m,n;
> >         for (m = 0; m <= M; m++) 
> >         {
> >                 // right-side streamline 
> >                 for (n = -N; n <= N; n++) 
> >                 {
> >                         z = g(m * dr + I * h(n * ds));
> >                         print_parts(z);
> >                 }               
> >                 // left-side streamline 
> >                 for (n = -N; n <= N; n++) 
> >                 {
> >                         z = g(-(m * dr) + I * h(n * ds));
> >                         print_parts(z);
> >                 }    
>            
>                   // get the missing left slit of singularity points
>                   // which appear on right-side
>                   for (n = -N; n <= N; n++) 
>                   {
>                          z = g(-FLT_EPSILON + I * h(n * ds));
>                          print_parts(z);
>                   } 
>               
> >         }

The code for obtaining the missing half circle 
should be put here instead of inside m-loop.
Either FLT_EPSILON or FLT_MIN will work.

           // get the missing left slit of singularity points
           // which appear on right-side
           for (n = -N; n <= N; n++) 
           {
                  z = g(-FLT_EPSILON + I * h(n * ds));
                  print_parts(z);
           } 

> > }


Harry Cheng
UC Davis




More information about the Numeric-interest mailing list