<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>contour2di</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>sept 2000</DATE>
  <SHORT_DESCRIPTION name="contour2di"> compute level curves of a surface on a 2D plot</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>[xc,yc]=contour2di(x,y,z,nz)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>x,y</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: two real row vectors of size n1 and n2: the grid.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>z</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: real matrix of size (n1,n2), the values of the function.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>nz</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: the level values or the number of levels.</SP>
          <PARAM_INDENT>
            <PARAM_ITEM>
              <PARAM_NAME>-  </PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP>If <VERB>nz</VERB> is an integer, its value gives the number of
  level curves  equally spaced from zmin to zmax as follows:</SP>
                <VERBATIM>
<![CDATA[
 z= zmin + (1:nz)*(zmax-zmin)/(nz+1)
   ]]>
                </VERBATIM>
                <P>
    Note that the <VERB>zmin</VERB> and <VERB>zmax</VERB> levels are not drawn  (generically they are reduced to points) but they can be added  with 
  </P>
                <VERBATIM>
<![CDATA[
 [im,jm] = find(z == zmin);     // or zmax 
 plot2d(x(im)',y(jm)',-9,"000")
   ]]>
                </VERBATIM>
                <P>
     - If <VERB>nz</VERB> is a vector, <VERB>nz(i)</VERB> gives the value of the ith level curve.
  </P>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>
          </PARAM_INDENT>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>xc,yc</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: vectors of identical sizes containing the contours definitions. See below for details.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P><VERB>contour2di</VERB> computes level curves of a surface <VERB>z=f(x,y)</VERB> on
    a 2D plot.  The values of <VERB>f(x,y)</VERB> are given by the matrix <VERB>z</VERB>
    at the grid points defined by <VERB>x</VERB> and <VERB>y</VERB>.</P>
    <P><VERB>xc(1)</VERB> contains the level associated with first contour path,
    <VERB>yc(1)</VERB> contains the number <VERB>N1</VERB> of points defining this contour path
    and (<VERB>xc(1+(1:N1))</VERB>, <VERB>yc(1+(1:N1))</VERB> ) contain the coordinates
    of the paths points.
    The second path begin at <VERB>xc(2+N1)</VERB> and <VERB>yc(2+N1)</VERB> and so on.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
[xc,yc]=contour2di(1:10,1:10,rand(10,10),5);
k=1;n=yc(k);c=1;
while k+yc(k)<size(xc,'*')
  n=yc(k);
  plot2d(xc(k+(1:n)),yc(k+(1:n)),c)
  c=c+1;
  k=k+n+1;
end

 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>contour</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>fcontour</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>fcontour2d</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>contour2d</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>plot2d</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>xset</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
  <AUTHOR>J.Ph.C.  </AUTHOR>
</MAN>
