<div>Hi ,</div>  <div>good to C a geologist on the list.</div>  <div>GRASS is rather poor when it comes to Geo symbology. Like showing</div>  <div>1. Dip and Strike of Bedding / Foliation</div>  <div>2. Folds and plunge</div>  <div>3. Lineation</div>  <div>4. Faults/ Grabens.. and the list gos on.</div>  <div>&nbsp;</div>  <div>We will be too happy to use Ur code for representing lineaments (intensity?)</div>  <div>ThanX in anticipation<BR><BR><B><I>"Carlos \"Guâno\" Grohmann" &lt;carlos.grohmann@gmail.com&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hello all,<BR><BR>I have this little program in C that reads the output of v.out.ascii<BR>and gives the azimuth and length of lines. I wrote the first version<BR>in my MSc and it appear in Grohmann 2004, Computers &amp; Geosciences.<BR>After that I re-wrote the original (in pascal) in C, and recently made<BR>some changes after suggestions from Ors
 Teglasy. I find it useful to<BR>create rose diagrams of lineament maps, and I'd like to put it on the<BR>WIKI site, but I'm not sure where should I put it (is there a section<BR>for this kind of thing?), so I'd like to hear from you guys.<BR><BR>Carlos<BR><BR><BR>--<BR>+-----------------------------------------------------------+<BR>Carlos Henrique Grohmann - Guano<BR>Geologist M.Sc - Doctorate Student at IGc-USP - Brazil<BR>Linux User #89721 - carlos dot grohmann at gmail dot com<BR>+-----------------------------------------------------------+<BR>_________________<BR>"Good morning, doctors. I have taken the liberty of removing Windows<BR>95 from my hard drive."<BR>--The winning entry in a "What were HAL's first words" contest judged<BR>by 2001: A SPACE ODYSSEY creator Arthur C. Clarke<BR>#include <STDIO.H><BR>#include <STRING.H><BR>#include <MATH.H><BR>#include <STDLIB.H><BR><BR>/* max vertex per line */<BR>#define MAX_VERTEX 100<BR>/* maxlines per file */<BR>#define
 MAX_LINHAS 5000<BR>/* PI */<BR>/*#define PI 3.141592654*/<BR><BR>FILE *entrada, *saida;<BR>char arquivo_in[30],arquivo_out[30];<BR>char header_stuff[12],linha[2],layer[1],layer_cat[7],cat[10];<BR>double utm_n[MAX_LINHAS][MAX_VERTEX],utm_e[MAX_LINHAS][MAX_VERTEX]; <BR>double dx,dy,azim,hyp,arc,m; <BR>int i,j,k,n_vertex[MAX_LINHAS],n_linhas,n_pontos; <BR><BR><BR>main()<BR>{<BR>system("clear"); /* clear screen */<BR><BR>/* legal notes...*/ <BR><BR>printf("\n************** AZIMUTH 0.5 **************\n\n");<BR>printf("AZIMUTH calculates azimuth and lengths of vector\n");<BR>printf("lines from DIG_ASCII files exported from GRASS-GIS.\n\n");<BR>printf("Carlos H. Grohmann. IGc-USP-Brasil. guano@usp.br\n");<BR>printf("Code improvement after suggestions from\n");<BR>printf("Örs Téglásy, Hungary. orsteglasy@yahoo.com\n");<BR>printf("This program is licenced under GPL 2.0 or later.\n\n");<BR><BR>printf("Your vector file should be exported with v.out.ascii\n");<BR>printf("using the
 'standard' format\n");<BR>printf("like this: v.out.ascii input=vector output=ascii format=standard\n");<BR>printf("---------------------------------------------------------\n");<BR>printf("WARNING: version &lt; 6.0 DIG_ASCII files have different format!\n");<BR>printf("Don't use them as input!\n");<BR>printf("WARNING: using -o (old format) option will result in incorrect output!\n");<BR>printf("---------------------------------------------------------\n\n");<BR><BR><BR>/* open input file... */<BR>printf("Input DIG-ASCII file: ");<BR>scanf("%s",&amp;arquivo_in);<BR>if(!(entrada=fopen(arquivo_in,"r")))<BR>{<BR>printf("\nError opening file!\n");<BR>exit(1);<BR>}<BR><BR>/* open output file...*/<BR>printf("\nOutput (Azimuth/Length) file: ");<BR>scanf("%s",&amp;arquivo_out);<BR>if((saida=fopen(arquivo_out,"w"))==NULL)<BR>{<BR>printf("\nCan't open file!\n");<BR>exit(1);<BR>}<BR><BR>/* read dig-ascii file header
 */<BR>while(!feof(entrada))<BR>{<BR>fscanf(entrada,"%s",&amp;header_stuff);<BR>if(strcmp(header_stuff,"VERTI:")==0) break;<BR>}<BR><BR>/* start line and vertex counters */<BR>j=0; /* line counter */<BR>k=0; /* vertex counter */<BR><BR>while(!feof(entrada))<BR>{ <BR>n_linhas=j;<BR>fscanf(entrada,"%s",&amp;linha);<BR>fscanf(entrada,"%d",&amp;n_vertex[j]);<BR>fscanf(entrada,"%d\n",&amp;layer);<BR><BR>/*put the vertex in arrays */<BR>for(k=0;k<N_VERTEX[J];K++)<BR> {<BR>fscanf(entrada,"%lf",&amp;utm_e[j][k]);<BR>fscanf(entrada,"%lf",&amp;utm_n[j][k]);<BR>}<BR>fscanf(entrada,"%s",&amp;layer_cat);<BR>fscanf(entrada,"%s",&amp;cat);<BR>j++;<BR><BR>}<BR><BR>printf("\nProcessing...\n");<BR><BR>for (j=0;j<N_LINHAS;J++)<BR> {<BR><BR>/* if it is a N-S line */<BR>if(utm_e[j][0]==utm_e[j][n_vertex[j]-1])<BR>azim=0,<BR>hyp=abs(utm_n[j][0]-utm_n[j][n_vertex[j]-1]);<BR>else<BR><BR>/* if it is a E-W line
 */<BR>if(utm_n[j][0]==utm_n[j][n_vertex[j]-1])<BR>azim=90,<BR>hyp=abs(utm_e[j][0]-utm_e[j][n_vertex[j]-1]);<BR>else<BR>/* if first point of line is to West of second point */<BR>if(utm_e[j][0]<UTM_E[J][N_VERTEX[J]-1])<BR> {<BR>printf("\n linha %d: x0 menor que x1 ", j+1),<BR>m=(utm_n[j][n_vertex[j]-1]-utm_n[j][0])/(utm_e[j][n_vertex[j]-1]-utm_e[j][0]),<BR>printf("m= %f ",m),<BR>dx=abs(utm_e[j][0]-utm_e[j][n_vertex[j]-1]),<BR>dy=abs(utm_n[j][0]-utm_n[j][n_vertex[j]-1]),<BR>hyp=hypot(dx,dy),<BR>arc=atan(dx/dy),<BR>azim=(arc*180)/M_PI;<BR>if(m&lt;0) azim=180-azim;<BR>printf("azim= %3.2f\n",azim);<BR>}<BR>else<BR><BR>/* if first point of line is to East of second point */<BR>if(utm_e[j][0]&gt;utm_e[j][n_vertex[j]-1])<BR>{<BR>printf("\n linha %d: x0 maior que x1 ", j+1),<BR>m=(utm_n[j][0]-utm_n[j][n_vertex[j]-1])/(utm_e[j][0]-utm_e[j][n_vertex[j]-1]),<BR>printf("m =%f
 ",m),<BR>dx=abs(utm_e[j][0]-utm_e[j][n_vertex[j]-1]),<BR>dy=abs(utm_n[j][0]-utm_n[j][n_vertex[j]-1]),<BR>hyp=hypot(dx,dy),<BR>arc=atan(dx/dy),<BR>azim=(arc*180)/M_PI;<BR>if(m&lt;0) azim=360-azim; else azim=180+azim;<BR>printf("azim= %3.2f\n",azim);<BR>}<BR><BR><BR><BR>fprintf(saida,"%3.2f %7.3f\n",azim,hyp);<BR><BR>}<BR><BR>printf("\n*** Done ***\n");<BR><BR>fclose(entrada);<BR>fclose(saida);<BR><BR>return 0;<BR>}<BR></BLOCKQUOTE><BR><p>
                <hr size=1>Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. <a href="http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com"> Great rates starting at 1&cent;/min.