type TPunto = array[1..4] of Real; var NumPuntos: Integer; procedure DefinirPunto(A, B, C, D: Real; var P: TPunto); begin P[1] := A; P[2] := B; P[3] := C; P[4] := D; end; function Real2Str(Numero: Real): String; var S: String; begin Str(Numero:10:3, S); while (S <> '') and (S[1] = ' ') do Delete(S, 1, 1); while (S <> '') and (S[Length(S)] = '0') do Dec(S[0]); if S[Length(S)] = '.' then Dec(S[0]); Real2Str := S; end; function Punto2Str(Punto: TPunto): String; var S: String; I: Word; begin S := ''; for I := 1 to 4 do S := S + ' ' + Real2Str(Punto[I]); Punto2Str := S; end; var i, j: Word; Salida: Text; u, v: Real; P: TPunto; begin Assign(Salida, 'google.rot'); Rewrite(Salida); Writeln(Salida, '# google.rot'); Writeln(Salida, '# '); Writeln(Salida, '# Francisco Javier Garc¡a Capit n'); Writeln(Salida); Writeln(Salida, '##layer "semiesfera"'); Writeln(Salida); NumPuntos := 100; for i := 1 to NumPuntos do begin v := (i/NumPuntos) * Pi/2; u := 0; DefinirPunto(cos(u) * cos(v), sin(u)*cos(v), sin(v), 0, P); Writeln(Salida, Punto2Str(P)); for j := 0 to NumPuntos do begin u := (j/NumPuntos) * 2* Pi; DefinirPunto(cos(u) * cos(v), sin(u)*cos(v), sin(v), 3, P); Writeln(Salida, Punto2Str(P)); end; end; Writeln(Salida); Writeln(Salida, '##layer "cono"'); Writeln(Salida); for j := 0 to NumPuntos do begin V := 0; DefinirPunto(0, 0, 1, 0, P); Writeln(Salida, Punto2Str(P)); u := (j/NumPuntos) * 2* Pi; DefinirPunto(cos(u) * cos(v), sin(u)*cos(v), sin(v), 4, P); Writeln(Salida, Punto2Str(P)); end; Close(Salida); end.