void CTest View CantorCP 2 P 0 CP
- Slides: 49
void CTest. View: : Cantor(CP 2 P 0, CP 2 P 1, int n)//Cantor函数 { if(0==n) { p. DC->Move. To(Round(P 0. x), Round(P 0. y)); p. DC->Line. To(Round(P 1. x), Round(P 1. y)); return; } CP 2 T 0, T 1; T 0. x=P 0. x+(P 1. x-P 0. x)/3. 0; T 1. y=P 0. y ; Cantor(P 0, T 0, n-1); T 1. x=P 0. x+2*(P 1. x-P 0. x)/3. 0; T 0. y=P 0. y ; Cantor(T 1, P 1, n-1); } Cantor演示
void CTest. View: : Koch(int n)//Koch函数 { if(0==n) { P 1. x=P 0. x+d*cos(Alpha); P 1. y=P 0. y+d*sin(Alpha); p. DC->Move. To(ROUND(P 0. x), ROUND(P 0. y)); p. DC->Line. To(ROUND(P 1. x), ROUND(P 1. y)); P 0=P 1; return; } Koch(n-1); Alpha+=Theta; Koch(n-1); Alpha-=2*Theta; Koch(n-1); Alpha+=Theta; Koch(n-1); }
void CTest. View: : Peano_Hilbert(int n, int s, CP 2 p 0, CP 2 p 1) { double w, h; if(0==n) { CP 2 p 2, p 3, p 4, p 5; w=p 1. x-p 0. x; h=p 1. y-p 0. y; p 2=CP 2(p 0. x+w/4, p 0. y+h/4); p 3=CP 2(p 0. x+(2 -s)*w/4, p 0. y+(2+s)*h/4); p 4=CP 2(p 0. x+3*w/4, p 0. y+3*h/4); p 5=CP 2(p 0. x+(2+s)*w/4, p 0. y+(2 -s)*h/4); p. DC->Move. To(Round(P 0. x), Round(P 0. y)); p. DC->Line. To(Round(p 2. x), Round(p 2. y)); p. DC->Line. To(Round(p 3. x), Round(p 3. y)); p. DC->Line. To(Round(p 4. x), Round(p 4. y)); p. DC->Line. To(Round(p 5. x), Round(p 5. y)); P 0=p 5; return; }
} CP 2 p 2, p 3, p 4, p 5, p 6; p 2=CP 2((p 0. x+p 1. x)/2, p 0. y); p 3=CP 2(p 1. x, (p 0. y+p 1. y)/2); p 4=CP 2((p 0. x+p 1. x)/2, p 1. y); p 5=CP 2(p 0. x, (p 0. y+p 1. y)/2); p 6=(p 0+p 1)/2; if(s>0) { Peano_Hilbert(n-1, p 0, p 6); //左 Peano_Hilbert(n-1, 1, p 5, p 4); //下 Peano_Hilbert(n-1, 1, p 6, p 1); //下 Peano_Hilbert(n-1, p 3, p 2); //左 } else { Peano_Hilbert(n-1, 1, p 0, p 6); //下 Peano_Hilbert(n-1, p 2, p 3); //左 Peano_Hilbert(n-1, p 6, p 1); //左 Peano_Hilbert(n-1, 1, p 4, p 5); //下 }
Sierpinski垫片的生成元顶点坐标之间的几何关系为 (8 -7) void CTest. View: : Gasket(int n, CP 2 p 0, CP 2 p 1, CP 2 p 2) { if(0==n) { Fill. Triangle(p 0, p 1, p 2); return; } CP 2 p 01, p 12, p 20; p 01=(p 0+p 1)/2; p 12=(p 1+p 2)/2; p 20=(p 2+p 0)/2; Gasket(n-1, p 01, p 20); Gasket(n-1, p 01, p 12); Gasket(n-1, p 20, p 12, p 2); }
Sierpinski垫片
, , void CTest. View: : Carpet(int n, CP 2 p 0, CP 2 p 1 )//地毯函数 { if(0==n) { Fill. Rectangle(p 0, p 1); return; } double w=p 1. x-p 0. x, h=p 1. y-p 0. y; CP 2 p 2, p 3, p 4, p 5, p 6, p 7, p 8, p 9, p 10, p 11, p 12, p 13; p 2=CP 2(p 0. x+w/3, p 0. y); p 3=CP 2(p 0. x+2*w/3, p 0. y); p 4=CP 2(p 1. x, p 0. y+h/3); p 5=CP 2(p 1. x, p 0. y+2*h/3); p 6=CP 2(p 0. x+2*w/3, p 1. y); p 7=CP 2(p 0. x+w/3, p 1. y); p 8=CP 2(p 0. x, p 0. y+2*h/3); p 9=CP 2(p 0. x, p 0. y+h/3); p 10=CP 2(p 0. x+w/3, p 0. y+h/3); p 11=CP 2(p 0. x+2*w/3, p 0. y+h/3); p 12=CP 2(p 0. x+2*w/3, p 0. y+2*h/3); p 13=CP 2(p 0. x+w/3, p 0. y+2*h/3);
, } Carpet(n-1, p 0, p 10); Carpet(n-1, p 2, p 11); Carpet(n-1, p 3, p 4); Carpet(n-1, p 9, p 13); Carpet(n-1, p 11, p 5); Carpet(n-1, p 8, p 7); Carpet(n-1, p 13, p 6); Carpet(n-1, p 12, p 1); , Sierpinski地毯
void CTest. View: : Cayley(int n, CP 2 p 0, double height, double theta)//Cayley函数 { CP 2 p 1, p 2, p 3; double Scale=2. 0/3. 0; if(1==n) return; p 1. x=p 0. x+height*cos(theta); p 1. y=p 0. y+height*sin(theta); p 2. x=p 1. x+Scale*height*cos(theta+Alpha); p 2. y=p 1. y+Scale*height*sin(theta+Alpha); p 3. x=p 1. x+Scale*height*cos(theta-Alpha); p 3. y=p 1. y+Scale*height*sin(theta-Alpha); p. DC->Move. To(Round(p 0. x), Round(p 0. y)); p. DC->Line. To(Round(p 1. x), Round(p 1. y)); p. DC->Line. To(Round(p 2. x), Round(p 2. y)); p. DC->Move. To(Round(p 1. x), Round(p 1. y)); p. DC->Line. To(Round(p 3. x), Round(p 3. y)); Cayley(n-1, p 1, Scale*height, theta+Alpha); Cayley(n-1, p 1, Scale*height, theta-Alpha); }
Cayley树
- Ctest debug
- Void main(void)
- Void loop
- Void main(void)
- Sections
- Components of operating systems
- Orthographic to isometric projection
- Me 111
- Partial views are an effective way to
- Simple view and complex view
- Example of half section
- Separatist view and the integration view
- For the view create view instructor_info as
- For the view create view instructor_info as
- Orthographic drawing title block
- Anatomy chest x ray
- Birds eye view examples
- Multi-view projection
- Simple view and complex view
- Revolved section
- Pull supply chain
- What is end elevation view
- Front view top view
- Simple view and complex view
- Void
- Void swap(int a int b)
- Void (*(*f[])())()
- #include stdio.h void main()
- Public class x public static void main
- Private void
- Arrayint
- #include stdio.h int main(void)
- Gm muktibodh
- C programming return statement
- Void exploit
- 7 crystal systems and 14 bravais lattices
- Public abstract class fish private void swim
- Void filter
- Noise2void
- Void print()
- Void swap
- Int f(int n)
- Public class test public static void main(string args)
- Perimeter stain blood
- Public static void main
- Algorithm finiteness
- Private void
- Delegate void
- Cs xxxx
- Public class x public static void main