id='OBGRA' matriz='sí' evaluar='una-sola-vez' columnas='400' filas='100' expresión='maxOBGRA=499;//_type;point=1;segment=2;control=3;triangle=4;plane=5;angle=6;curve=7;circle=8;sphere=9;circ3D=10;conic5pts=11;cubic9pts=12;;continuo=0;a_rayas=1;punteado=2;;// GENERALES, PUNTOS, CONTROLES y SEGMENTOS;_1=0;_2=1;_x=0;_y=1;_z=2;_w=3;_type=4;_col=5;_wdth=6;_name=7;_subix=8;_show=9;_func=10;_cnstr=11 // constricción;_oculto=12;_invisible=13;_constr=14  // constructor;_rastro=15;_isLine=16;_es_Reglado_=17;_invalid=18;_cnstool_=19;_linestyle=20;;// AUXILIARES;_p1=21;_p2=22;_p3=23;_p4=24;_p5=25;_p6=26;_p7=27;_p8=28;_p9=29;;// CONTROLES e INTERSECCIONES;_prprtn=30;_side=31;_otherP=32;_dirx=33;_diry=33;_dirz=33;;// ÁNGULOS;_v1x=30;_v1y=31;_v1z=32;_v2x=33;_v2y=34;_v2z=35;_rad=36;;// PLANOS;_Pt1=30;_Pt2=31;_pa=32;_pb=33;_pc=34;_pd=35;_vsP=36;_cut=37;_npo=38 //needs 1+6*3=19 free for border points;_np1=57 //needs 1+6*3=19 free for _vsP border1;_np2=76 //needs 1+6*3=19 free for _vsP border2 top=95;;// RECTAS y SEGMENTOS;_crossx=30;_crossy=31;_crossw=32;_crossz=32;_3DLx1_=33;_3DLy1_=34;_3DLz1_=35;_3DLx2_=36;_3DLy2_=37;_3DLz2_=38;_L_x0=40;_L_y0=41;_L_w0=42;_L_z0=42;_L_x1=43;_L_y1=44;_L_z1=45;_L_x2=46;_L_y2=47;_L_z2=48;_L_ux=49;_L_uy=50;_L_uz=51;_vsL=52;_xin=53;_near1=54;_near2=55;_is2P=56;_is2D=57;_a1=58;_b1=59;_c1=60;_d1=61;_a2=62;_b2=63;_c2=64;_d2=65;_Le41=71;_Le42=72;_Le43=73;_Le23=74;_Le31=75;_Le12=76;_xinfty_=77;_yinfty_=78;_zinfty_=79;_xnear_=80;_ynear_=81;_znear_=82;_which=83;;// CÍRCULOS y ESFERAS;_centro=30;_radio=31;_r=32;_r32=33;_cy=34;_sy=35;_cz=36;_sz=37;_rxy=38;_Nx=39;_Ny=40;_Nz=41;_nx=42;_ny=43;_nz=44;_tx=45;_ty=46;_tz=47;_x32=48;_y32=49;_xc=50;_yc=51;_zc=52;;// CURVAS cónicas y cuádricas;_Axx_=60;_Bxy_=61;_Cyy_=62;_Dx_=63;_Ey_=64;_F_=65;_3xxx_=66;_3xxy_=67;_3xyy_=68;_3yyy_=69;_2xx_=70;_2xy_=71;_2yy_=72;_1x_=73;_1y_=74;_0_=75;_Eq_=76;_c2g_=77;_flat_=100;;vm_work=0;vm_view=1;vm_read=2;vm_wkrd=2;vm_vwrd=3;;rm_L=&squot;L&squot;;rm_R=&squot;R&squot;;rm_T=&squot;T&squot;;rm_B=&squot;B&squot;;rm_TL=&squot;TL&squot;;rm_BL=&squot;BL&squot;;rm_TR=&squot;TR&squot;;rm_BR=&squot;BR&squot;;;;;;;;;' tipo='matriz' 
id='cleanOBGRA()' algoritmo='sí' expresión='0' local='i' inicio='i=0' hacer='OBGRA[i%OBGRA.filas,ent(i/OBGRA.filas)]=0;i=i+1' mientras='i<OBGRA.columnas*OBGRA.filas' tipo='función' 
id='ANG' matriz='sí' evaluar='una-sola-vez' columnas='3' filas='38' expresión='xang=0;yang=1;zang=2' tipo='matriz' 
id='CURVA' matriz='sí' evaluar='una-sola-vez' columnas='10' filas='360' tipo='matriz' 
id='CURVA2G' matriz='sí' evaluar='una-sola-vez' columnas='10' filas='360' expresión='_C2GA=0;_C2GB=1;_C2GC=2;_C2GD=3;_C2GE=4;_C2GF=5' tipo='matriz' 
id='REGLADO' matriz='sí' evaluar='una-sola-vez' columnas='10' filas='145' tipo='matriz' 
id='HIDDENCOL' matriz='sí' evaluar='una-sola-vez' columnas='20' filas='50' tipo='matriz' 
id='HIDDENOBJ' matriz='sí' evaluar='una-sola-vez' columnas='20' filas='50' tipo='matriz' 
id='ROTAR' matriz='sí' evaluar='una-sola-vez' columnas='3' filas='3' tipo='matriz' 
id='____AUXILIARES____' expresión='0' tipo='variable' 
id='isVisible(n)' algoritmo='sí' expresión='v' local='v' hacer='v=(!OBGRA[n,_invisible])&(!OBGRA[n,_invalid]);v=v&(!COL[OBGRA[n,_col],_hidden])&(!OBGRA[n,_oculto]);v=v&!hiddenObjInThisStep(n);' tipo='función' 
id='grados(s)' algoritmo='sí' expresión='acos(g)*180/pi' local='g' hacer='g=OBGRA[s,_v1x]*OBGRA[s,_v2x]+OBGRA[s,_v1y]*OBGRA[s,_v2y]+OBGRA[s,_v1z]*OBGRA[s,_v2z];g=g/sqrt((OBGRA[s,_v1x]^2+OBGRA[s,_v1y]^2+ OBGRA[s,_v1z]^2)*(OBGRA[s,_v2x]^2+OBGRA[s,_v2y]^2+OBGRA[s,_v2z]^2));;' tipo='función' 
id='area(s)' algoritmo='sí' expresión='sqrt(S)' local='a,b,c,sp,S' hacer='a=dist(OBGRA[s,_p1], OBGRA[s,_p2]);b=dist(OBGRA[s,_p2], OBGRA[s,_p3]);c=dist(OBGRA[s,_p3], OBGRA[s,_p1]);sp=(a+b+c)/2;S=max(0,sp*(sp-a)*(sp-b)*(sp-c));' tipo='función' 
id='hasName(n)' algoritmo='no' expresión='((OBGRA[n,_name]!=&squot;&squot;)| (OBGRA[n,_subix]!=&squot;&squot;))&((OBGRA[n,_type]==angle)|(OBGRA[n,_type]==point)|(OBGRA[s,_type]==control)|(OBGRA[s,_type]==segment)|(OBGRA[s,_type]==triangle))' tipo='función' 
id='getName(s)' algoritmo='sí' expresión='nom' local='nom,ix,d,a,' hacer='nom=&squot;\${&squot;+OBGRA[s,_name];nom=(OBGRA[s,_subix]!=&squot;&squot;)?nom+&squot;_{&squot;+OBGRA[s,_subix]+&squot;}}&squot;:nom+ &squot;}&squot;;ix=(OBGRA[s,_type]==segment)?_indexOf_(nom,&squot;<L>&squot;):-1;d=((OBGRA[s,_type]==segment)&(ix>=0))?rNd(4,dist(OBGRA[s,0],OBGRA[s,1])):&squot;&squot;;nom=((OBGRA[s,_type]==segment)&(ix>=0))?_replace_(nom,&squot;<L>&squot;,d):nom;ix=(OBGRA[s,_type]==angle)?_indexOf_(nom,&squot;<A>&squot;):-1;a=((OBGRA[s,_type]==angle)&(ix>=0))?&squot;&squot;+rNd(1,grados(s))+&squot;°&squot;:&squot;&squot;;nom=((OBGRA[s,_type]==angle)&(ix>=0))?_replace_(nom,&squot;<A>&squot;,a):nom;ix=(OBGRA[s,_type]==triangle)?_indexOf_(nom,&squot;<S>&squot;):-1;S=(OBGRA[s,_type]==triangle)&(ix>=0)?&squot;&squot;+rNd(8,area(s)):&squot;&squot;;nom=((OBGRA[s,_type]==triangle)&(ix>=0))?_replace_(nom,&squot;<S>&squot;,S):nom;;' tipo='función' 
id='getColSz(n)' algoritmo='sí' expresión='1' hacer='ancho=OBGRA[n,_wdth];color=OBGRA[n,_col];colix=color-start_color;estilo=OBGRA[n,_linestyle];;' tipo='función' 
id='setColSz(n)' algoritmo='sí' expresión='1' hacer='OBGRA[n,_wdth]=ancho;OBGRA[n,_col]=getColor(colix);OBGRA[n,_linestyle]=estilo;;' tipo='función' 
id='setStyle(n,estilo)' algoritmo='sí' expresión='1' hacer='OBGRA[n,_linestyle]=estilo;' tipo='función' 
id='setSz(n,sz)' algoritmo='sí' expresión='OBGRA[n,_wdth]' hacer='OBGRA[n,_wdth]=sz;;' tipo='función' 
id='setCol(n)' algoritmo='sí' expresión='1' hacer='OBGRA[n,_col]=getColor(colix);;' tipo='función' 
id='hayOcultos()' algoritmo='sí' expresión='siHay&(NOG>minNOG)' local='siHay,n' inicio='siHay=0;n=minNOG' hacer='siHay=siHay|OBGRA[n,_oculto]|(OBGRA[n,_wdth]==0);n=n+1' mientras='(!siHay)&(n<NOG)' tipo='función' 
id='MostrarTodo()' algoritmo='sí' expresión='1' local='n' inicio='n=0' hacer='OBGRA[n,_oculto]=0;n=n+1' mientras='n<maxOBGRA' tipo='función' 
id='minSize1()' algoritmo='sí' expresión='1' local='n' inicio='n=0' hacer='OBGRA[n,_wdth]=((OBGRA[n,_wdth]==0)&(OBGRA[n,_type]!=control))?setSz(n,1):OBGRA[n,_wdth];n=n+1' mientras='n<maxOBGRA' tipo='función' 
id='X2(p)' algoritmo='no' expresión='OBGRA[p,_x]/OBGRA[p,_w]' tipo='función' 
id='Y2(p)' algoritmo='no' expresión='OBGRA[p,_y]/OBGRA[p,_w]' tipo='función' 
id='Z2(p)' algoritmo='no' expresión='OBGRA[p,_z]/OBGRA[p,_w]' tipo='función' 
id='____DISTANCES____' expresión='0' tipo='variable' 
id='distAL2D(xx,yy,L)' algoritmo='sí' expresión='dS' local='dS,xA,yA,xB,yB,ABdx,ABdx,AB,t' hacer='xA=OBGRA[L,_3DLx1_];yA=OBGRA[L,_3DLy1_];xB=OBGRA[L,_3DLx2_];yB=OBGRA[L,_3DLy2_];;ABdx=xB-xA;ABdy=yB-yA;AB=sqrt(ABdx^2+ABdy^2);t=((xx-xA)*ABdx+(yy-yA)*ABdy)/AB;dS=sqrt((xx-xA-t*ABdx/AB)^2+(yy-yA-t*ABdy/AB)^2);;;' tipo='función' 
id='distAL32(xx,yy,L)' algoritmo='sí' expresión='dL' local='xA,yA,xB,yB,ABdx,ABdx,AB,t,dL' hacer='xB=X32(OBGRA[L,_3DLx2_],OBGRA[L,_3DLy2_],OBGRA[L,_3DLz2_]);xA=X32(OBGRA[L,_3DLx1_],OBGRA[L,_3DLy1_],OBGRA[L,_3DLz1_]);yB=Y32(OBGRA[L,_3DLx2_],OBGRA[L,_3DLy2_],OBGRA[L,_3DLz2_]);yA=Y32(OBGRA[L,_3DLx1_],OBGRA[L,_3DLy1_],OBGRA[L,_3DLz1_]);ABdx=xB-xA;ABdy=yB-yA;AB=sqrt(ABdx^2+ABdy^2);t=((xx-xA)*ABdx+(yy-yA)*ABdy)/AB;dL=sqrt((xx-xA-t*ABdx/AB)^2+(yy-yA-t*ABdy/AB)^2);dL=((0<t)&(t<AB))?dL:1000000;;;;' tipo='función' 
id='distAS2D(xx,yy,S)' algoritmo='sí' expresión='dS' local='A,B,ABdx,ABdx,AB,t,dS,ok1,ok2' hacer='A=OBGRA[S,_1];B=OBGRA[S,_2];ABdx=X2(B)-X2(A);ABdy=Y2(B)-Y2(A);AB=sqrt(ABdx^2+ABdy^2);t=((xx-X2(A))*ABdx+(yy-Y2(A))*ABdy)/AB;dS=sqrt((xx-X2(A)-t*ABdx/AB)^2+(yy-Y2(A)-t*ABdy/AB)^2);ok1=((OBGRA[S,_vsL]<0)|((OBGRA[S,_vsL]>minNOG)&!OBGRA[S,_xin]))&(0<t)&(t<AB);ok2=(OBGRA[S,_vsL]>minNOG)&OBGRA[S,_xin]&((t<0)|(AB<t));dS=(ok1|ok2)?dS:1000000;;;' tipo='función' 
id='distAS32(xx,yy,S)' algoritmo='sí' expresión='dS' local='A,B,ABdx,ABdx,AB,t,dS,ok1,ok2' hacer='A=OBGRA[S,_1];B=OBGRA[S,_2];ABdx=x32(B)-x32(A);ABdy=y32(B)-y32(A);AB=sqrt(ABdx^2+ABdy^2);t=((xx-x32(A))*ABdx+(yy-y32(A))*ABdy)/AB;dS=sqrt((xx-x32(A)-t*ABdx/AB)^2+(yy-y32(A)-t*ABdy/AB)^2);ok1=((OBGRA[S,_vsL]<0)|((OBGRA[S,_vsL]>minNOG)&!OBGRA[S,_xin]))&(0<t)&(t<AB);ok2=(OBGRA[S,_vsL]>minNOG)&OBGRA[S,_xin]&((t<0)|(AB<t));dS=(ok1|ok2)?dS:1000000;;;;' tipo='función' 
id='distToCirc3D(x,y,s)' algoritmo='sí' expresión='d' local='d,newd,t,dt,i' inicio='d=1000000;t==0;dt=2*pi/36;i=0' hacer='xn=X32(OBGRA[s,_xc]+OBGRA[s,_r]*(OBGRA[s,_nx]*cos(t)+OBGRA[s,_tx]*sen(t)),OBGRA[s,_yc]+OBGRA[s,_r]*(OBGRA[s,_ny]*cos(t)+OBGRA[s,_ty]*sen(t)),OBGRA[s,_zc]+OBGRA[s,_r]*(OBGRA[s,_nz]*cos(t)+OBGRA[s,_tz]*sen(t)));yn=Y32(OBGRA[s,_xc]+OBGRA[s,_r]*(OBGRA[s,_nx]*cos(t)+OBGRA[s,_tx]*sen(t)),OBGRA[s,_yc]+OBGRA[s,_r]*(OBGRA[s,_ny]*cos(t)+OBGRA[s,_ty]*sen(t)),OBGRA[s,_zc]+OBGRA[s,_r]*(OBGRA[s,_nz]*cos(t)+OBGRA[s,_tz]*sen(t)));d=min(sqrt((xn-x)^2+(yn-y)^2),d);t=t+dt;i=i+1' mientras='i<36' tipo='función' 
id='distAOB(xx,yy,n)' algoritmo='sí' expresión='d' local='d' hacer='d=((OBGRA[n,_type]==point)|(OBGRA[n,_type]==control)|(OBGRA[n,_type]==segment))?distance(xx,yy,n):d;d=((OBGRA[n,_type]==circle))?abs(distance(xx,yy,OBGRA[n,_centro])-OBGRA[n,_r]):d;d=((OBGRA[n,_type]==circ3D))?distToCirc3D(xx,yy,n):d;' tipo='función' 
id='distance(x,y,n)' algoritmo='sí' expresión='d' local='d,isP,isL,isS' inicio='d=1000000' hacer='isP=(OBGRA[n,_type]==control)|(OBGRA[n,_type]==point);isL=(OBGRA[n,_type]==segment)&(OBGRA[n,_isLine]);isS=(OBGRA[n,_type]==segment)&(!OBGRA[n,_isLine]);d=(isP&show_E2)?sqrt((X2(n)-x)^2+(Y2(n)-y)^2):d;d=(isP&show_E3)?sqrt((x32(n)-x)^2+(y32(n)-y)^2):d;d=(isL&show_E2)?distAL2D(x,y,n):d;d=(isL&show_E3)?distAL32(x,y,n):d;d=(isS&show_E2)?distAS2D(x,y,n):d;d=(isS&show_E3)?distAS32(x,y,n):d' tipo='función' 
id='dist(p,q)' algoritmo='no' expresión='sqrt((X2(q)-X2(p))^2+(Y2(q)-Y2(p))^2+(Z2(q)-Z2(p))^2)' tipo='función' info='dist, distancia entre puntos 3D p y q' 
id='dist2D(A,B)' algoritmo='no' expresión='sqrt((X2(B)-X2(A))^2+(Y2(B)-Y2(A))^2)' tipo='función' info='distancia entre puntos 2D A y B' 
id='isInL2D(L,p)' algoritmo='no' expresión='abs((X2(p)-OBGRA[L,_L_x1])*OBGRA[L,_L_uy]-(Y2(p)-OBGRA[L,_L_y1])*OBGRA[L,_L_ux])<epsilon' tipo='función' 
id='isInEq(Eq,p)' algoritmo='sí' expresión='abs(y)<epsilon' local='a,b,c,d,e,f,y' hacer='a=OBGRA[Eq,_Axx_];b=OBGRA[Eq,_Bxy_];c=OBGRA[Eq,_Cyy_];d=OBGRA[Eq,_Dx_];e=OBGRA[Eq,_Ey_];f=OBGRA[Eq,_F_];y=(a*X2(p)+b*Y2(p)+d)*X2(p)+(c*Y2(p)+e)*Y2(p)+f;' tipo='función' 
id='isPoint(p)' algoritmo='no' expresión='(OBGRA[p,_type]==point)' tipo='función' 
id='isInC(C,p)' algoritmo='no' expresión='(abs(dist(p,OBGRA[C,_centro])-OBGRA[C,_r]))<epsilon' tipo='función'