Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,62 +0,0 @@
|
|||
with PDF_Out; use PDF_Out;
|
||||
|
||||
procedure Peano_Curve is
|
||||
|
||||
Filename : constant String := "peano-curve.pdf";
|
||||
Order : constant Positive := 4;
|
||||
Scale : constant Real := 2.1;
|
||||
Line_Width : constant Real := 2.5;
|
||||
Corner : constant Point := (150.0, 50.0);
|
||||
Background : constant Color_Type := (0.827, 0.816, 0.016);
|
||||
Frame : constant Rectangle := (10.0, 10.0, 820.0, 575.0);
|
||||
PDF : PDF_Out_File;
|
||||
|
||||
type Coord is record
|
||||
X, Y : Natural;
|
||||
end record;
|
||||
|
||||
function "+" (Left : Coord; Right : Coord) return Coord
|
||||
is ((Left.X + Right.X, Left.Y + Right.Y));
|
||||
|
||||
function "*" (Left : Natural; Right : Coord) return Coord
|
||||
is ((Left * Right.X, Left * Right.Y));
|
||||
|
||||
procedure Peano (Pos : Coord; Length : Positive; I1, I2 : Integer) is
|
||||
Len : constant Integer := Length / 3;
|
||||
begin
|
||||
if Length = 1 then
|
||||
PDF.Line (Corner + Scale * (Real (3 * Pos.X), Real (3 * Pos.Y)));
|
||||
else
|
||||
Peano (Pos + Len * (2 * I1, 2 * I1), Len, I1, I2);
|
||||
Peano (Pos + Len * (I1 - I2 + 1, I1 + I2), Len, I1, 1 - I2);
|
||||
Peano (Pos + Len * (1, 1), Len, I1, 1 - I2);
|
||||
Peano (Pos + Len * (I1 + I2, I1 - I2 + 1), Len, 1 - I1, 1 - I2);
|
||||
Peano (Pos + Len * (2 * I2, 2 - 2 * I2), Len, I1, I2);
|
||||
Peano (Pos + Len * (1 + I2 - I1, 2 - I1 - I2), Len, I1, I2);
|
||||
Peano (Pos + Len * (2 - 2 * I1, 2 - 2 * I1), Len, I1, I2);
|
||||
Peano (Pos + Len * (2 - I1 - I2, 1 + I2 - I1), Len, 1 - I1, I2);
|
||||
Peano (Pos + Len * (2 - 2 * I2, 2 * I2), Len, 1 - I1, I2);
|
||||
end if;
|
||||
end Peano;
|
||||
|
||||
procedure Draw_Peano is
|
||||
begin
|
||||
PDF.Stroking_Color (Black);
|
||||
PDF.Line_Width (Line_Width);
|
||||
PDF.Move (Corner);
|
||||
Peano ((0, 0), 3**Order, 0, 0);
|
||||
PDF.Finish_Path (Close_Path => False,
|
||||
Rendering => Stroke,
|
||||
Rule => Nonzero_Winding_Number);
|
||||
end Draw_Peano;
|
||||
|
||||
begin
|
||||
PDF.Create (Filename);
|
||||
PDF.Page_Setup (A4_Landscape);
|
||||
|
||||
PDF.Color (Background);
|
||||
PDF.Draw (Frame, Fill);
|
||||
|
||||
Draw_Peano;
|
||||
PDF.Close;
|
||||
end Peano_Curve;
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
option explicit
|
||||
'outputs turtle graphics to svg file and opens it
|
||||
|
||||
const pi180= 0.01745329251994329576923690768489 ' pi/180
|
||||
const pi=3.1415926535897932384626433832795 'pi
|
||||
class turtle
|
||||
|
||||
dim fso
|
||||
dim fn
|
||||
dim svg
|
||||
|
||||
dim iang 'radians
|
||||
dim ori 'radians
|
||||
dim incr
|
||||
dim pdown
|
||||
dim clr
|
||||
dim x
|
||||
dim y
|
||||
|
||||
public property let orient(n):ori = n*pi180 :end property
|
||||
public property let iangle(n):iang= n*pi180 :end property
|
||||
public sub pd() : pdown=true: end sub
|
||||
public sub pu() :pdown=FALSE :end sub
|
||||
|
||||
public sub rt(i)
|
||||
ori=ori - i*iang:
|
||||
if ori<0 then ori = ori+pi*2
|
||||
end sub
|
||||
public sub lt(i):
|
||||
ori=(ori + i*iang)
|
||||
if ori>(pi*2) then ori=ori-pi*2
|
||||
end sub
|
||||
|
||||
public sub bw(l)
|
||||
x= x+ cos(ori+pi)*l*incr
|
||||
y= y+ sin(ori+pi)*l*incr
|
||||
end sub
|
||||
|
||||
public sub fw(l)
|
||||
dim x1,y1
|
||||
x1=x + cos(ori)*l*incr
|
||||
y1=y + sin(ori)*l*incr
|
||||
if pdown then line x,y,x1,y1
|
||||
x=x1:y=y1
|
||||
end sub
|
||||
|
||||
Private Sub Class_Initialize()
|
||||
setlocale "us"
|
||||
initsvg
|
||||
pdown=true
|
||||
end sub
|
||||
|
||||
Private Sub Class_Terminate()
|
||||
disply
|
||||
end sub
|
||||
|
||||
private sub line (x,y,x1,y1)
|
||||
svg.WriteLine "<line x1=""" & x & """ y1= """& y & """ x2=""" & x1& """ y2=""" & y1 & """/>"
|
||||
end sub
|
||||
|
||||
private sub disply()
|
||||
dim shell
|
||||
svg.WriteLine "</svg></body></html>"
|
||||
svg.close
|
||||
Set shell = CreateObject("Shell.Application")
|
||||
shell.ShellExecute fn,1,False
|
||||
end sub
|
||||
|
||||
private sub initsvg()
|
||||
dim scriptpath
|
||||
Set fso = CreateObject ("Scripting.Filesystemobject")
|
||||
ScriptPath= Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\"))
|
||||
fn=Scriptpath & "SIERP.HTML"
|
||||
Set svg = fso.CreateTextFile(fn,True)
|
||||
if SVG IS nothing then wscript.echo "Can't create svg file" :vscript.quit
|
||||
svg.WriteLine "<!DOCTYPE html>" &vbcrlf & "<html>" &vbcrlf & "<head>"
|
||||
svg.writeline "<style>" & vbcrlf & "line {stroke:rgb(255,0,0);stroke-width:.5}" &vbcrlf &"</style>"
|
||||
svg.writeline "</head>"&vbcrlf & "<body>"
|
||||
svg.WriteLine "<svg xmlns=""http://www.w3.org/2000/svg"" width=""800"" height=""800"" viewBox=""0 0 800 800"">"
|
||||
end sub
|
||||
end class
|
||||
|
||||
sub peano (n,a)
|
||||
if n=0 then exit sub
|
||||
x.rt a
|
||||
peano n-1, -a
|
||||
x.fw 1
|
||||
peano n-1, a
|
||||
x.fw 1
|
||||
peano n-1, -a
|
||||
x.lt a
|
||||
end sub
|
||||
|
||||
dim x,i
|
||||
set x=new turtle
|
||||
x.iangle=90
|
||||
x.orient=0
|
||||
x.incr=7
|
||||
x.x=100:x.y=500
|
||||
peano 7,1
|
||||
set x=nothing 'show image in browser
|
||||
Loading…
Add table
Add a link
Reference in a new issue