fbpx
Wikipedia

Sierpiński curve

Sierpiński curves are a recursively defined sequence of continuous closed plane fractal curves discovered by Wacław Sierpiński, which in the limit completely fill the unit square: thus their limit curve, also called the Sierpiński curve, is an example of a space-filling curve.

Because the Sierpiński curve is space-filling, its Hausdorff dimension (in the limit ) is .
The Euclidean length of the th iteration curve is

i.e., it grows exponentially with beyond any limit, whereas the limit for of the area enclosed by is that of the square (in Euclidean metric).

Sierpiński curve ("Sierpinski's square snowflake"[1]) of first order
Sierpiński curves of orders 1 and 2
Sierpiński curves of orders 1 to 3
Sierpinski "square curve"[2] of orders 2–4

Uses of the curve edit

The Sierpiński curve is useful in several practical applications because it is more symmetrical than other commonly studied space-filling curves. For example, it has been used as a basis for the rapid construction of an approximate solution to the Travelling Salesman Problem (which asks for the shortest sequence of a given set of points): The heuristic is simply to visit the points in the same sequence as they appear on the Sierpiński curve.[3] To do this requires two steps: First compute an inverse image of each point to be visited; then sort the values. This idea has been used to build routing systems for commercial vehicles based only on Rolodex card files.[4]

A space-filling curve is a continuous map of the unit interval onto a unit square and so a (pseudo) inverse maps the unit square to the unit interval. One way of constructing a pseudo-inverse is as follows. Let the lower-left corner (0, 0) of the unit square correspond to 0.0 (and 1.0). Then the upper-left corner (0, 1) must correspond to 0.25, the upper-right corner (1, 1) to 0.50, and the lower-right corner (1, 0) to 0.75. The inverse map of interior points are computed by taking advantage of the recursive structure of the curve.

Here is a function coded in Java that will compute the relative position of any point on the Sierpiński curve (that is, a pseudo-inverse value). It takes as input the coordinates of the point (x,y) to be inverted, and the corners of an enclosing right isosceles triangle (ax, ay), (bx, by), and (cx, cy). (The unit square is the union of two such triangles.) The remaining parameters specify the level of accuracy to which the inverse should be computed.

 static long sierp_pt2code( double ax, double ay, double bx, double by, double cx, double cy,  int currentLevel, int maxLevel, long code, double x, double y )   {  if (currentLevel <= maxLevel) {  currentLevel++;  if ((sqr(x-ax) + sqr(y-ay)) < (sqr(x-cx) + sqr(y-cy))) {  code = sierp_pt2code( ax, ay, (ax+cx)/2.0, (ay+cy)/2.0, bx, by,  currentLevel, maxLevel, 2 * code + 0, x, y );  }  else {  code = sierp_pt2code( bx, by, (ax+cx)/2.0, (ay+cy)/2.0, cx, cy,  currentLevel, maxLevel, 2 * code + 1, x, y );  }  }  return code;   } 

Representation as Lindenmayer system edit

The Sierpiński curve can be expressed by a rewrite system (L-system).

Alphabet: F, G, X
Constants: F, G, +, −
Axiom: F−−XF−−F−−XF
Production rules:
X → XF+G+XF−−F−−XF+G+X
Angle: 45

Here, both F and G mean "draw forward", + means "turn left 45°", and means "turn right 45°" (see turtle graphics). The curve is usually drawn with different lengths for F and G.

The Sierpiński square curve can be similarly expressed:

Alphabet: F, X
Constants: F, +, −
Axiom: F+XF+F+XF
Production rules:
X → XF−F+F−XF+F+XF−F+F−X
Angle: 90

Arrowhead curve edit

The Sierpiński arrowhead curve is a fractal curve similar in appearance and identical in limit to the Sierpiński triangle.

 
Evolution of Sierpiński arrowhead curve

The Sierpiński arrowhead curve draws an equilateral triangle with triangular holes at equal intervals. It can be described with two substituting production rules: (A → B-A-B) and (B → A+B+A). A and B recur and at the bottom do the same thing — draw a line. Plus and minus (+ and -) mean turn 60 degrees either left or right. The terminating point of the Sierpiński arrowhead curve is always the same provided you recur an even number of times and you halve the length of the line at each recursion. If you recur to an odd depth (order is odd) then you end up turned 60 degrees, at a different point in the triangle.

An alternate constriction is given in the article on the de Rham curve: one uses the same technique as the de Rham curves, but instead of using a binary (base-2) expansion, one uses a ternary (base-3) expansion.

Code edit

Given the drawing functions void draw_line(double distance); and void turn(int angle_in_degrees);, the code to draw an (approximate) Sierpiński arrowhead curve looks like this:

void sierpinski_arrowhead_curve(unsigned order, double length) {  // If order is even we can just draw the curve.  if ( 0 == (order & 1) ) {  curve(order, length, +60);  }  else /* order is odd */ {  turn( +60);  curve(order, length, -60);  } } 
void curve(unsigned order, double length, int angle) {  if ( 0 == order ) {  draw_line(length);  } else {  curve(order - 1, length / 2, -angle);  turn(angle);  curve(order - 1, length / 2, angle);  turn(angle);  curve(order - 1, length / 2, -angle);  } } 

Representation as Lindenmayer system edit

 
Like many two-dimensional fractal curves, the Sierpiński arrowhead curve can be extended to three dimensions

The Sierpiński arrowhead curve can be expressed by a rewrite system (L-system).

Alphabet: X, Y
Constants: F, +, −
Axiom: XF
Production rules:
X → YF + XF + Y
Y → XF − YF − X

Here, F means "draw forward", + means "turn left 60°", and means "turn right 60°" (see turtle graphics).

See also edit

References edit

  1. ^ Weisstein, Eric W. "Sierpiński Curve". MathWorld. Retrieved 21 January 2019.
  2. ^ Dickau, Robert M. (1996/7)"Two-dimensional L-systems", Robert's Math Figures. MathForum.org. Retrieved 21 January 2019.
  3. ^ Platzman, Loren K.; Bartholdi, John J. III (1989). "Spacefilling curves and the planar traveling salesman problem". Journal of the Association for Computing Machinery. 36 (4): 719–737. doi:10.1145/76359.76361.
  4. ^ Bartholdi, John J. III. "Some combinatorial applications of spacefilling curves". Georgia Institute of Technology. Archived from the original on 2012-08-03.

Further reading edit

  • Peitgen, H.-O.; Jürgens, H.; Saupe, D. (2013) [1992]. Chaos and Fractals: New Frontiers of Science. Springer. ISBN 978-1-4757-4740-9.
  • Stevens, Roger T. (1989). Fractal Programming in C. M&T Books. ISBN 978-1-55851-037-1.

sierpiński, curve, this, article, missing, information, about, other, sierpiński, curve, wolfram, mathworld, please, expand, article, include, this, information, further, details, exist, talk, page, january, 2019, sierpinski, square, snowflake, redirects, here. This article is missing information about other Sierpinski curves see Sierpinski Curve on Wolfram MathWorld Please expand the article to include this information Further details may exist on the talk page January 2019 Sierpinski square snowflake redirects here For other uses see Sierpinski carpet Sierpinski curves are a recursively defined sequence of continuous closed plane fractal curves discovered by Waclaw Sierpinski which in the limit n displaystyle n to infty completely fill the unit square thus their limit curve also called the Sierpinski curve is an example of a space filling curve Because the Sierpinski curve is space filling its Hausdorff dimension in the limit n displaystyle n to infty is 2 displaystyle 2 The Euclidean length of the n displaystyle n th iteration curve S n displaystyle S n is l n 2 3 1 2 2 n 1 3 2 2 1 2 n displaystyle l n 2 over 3 1 sqrt 2 2 n 1 over 3 2 sqrt 2 1 over 2 n i e it grows exponentially with n displaystyle n beyond any limit whereas the limit for n displaystyle n to infty of the area enclosed by S n displaystyle S n is 5 12 displaystyle 5 12 that of the square in Euclidean metric Sierpinski curve Sierpinski s square snowflake 1 of first order Sierpinski curves of orders 1 and 2 Sierpinski curves of orders 1 to 3Sierpinski square curve 2 of orders 2 4Contents 1 Uses of the curve 2 Representation as Lindenmayer system 3 Arrowhead curve 3 1 Code 3 2 Representation as Lindenmayer system 4 See also 5 References 6 Further readingUses of the curve editThe Sierpinski curve is useful in several practical applications because it is more symmetrical than other commonly studied space filling curves For example it has been used as a basis for the rapid construction of an approximate solution to the Travelling Salesman Problem which asks for the shortest sequence of a given set of points The heuristic is simply to visit the points in the same sequence as they appear on the Sierpinski curve 3 To do this requires two steps First compute an inverse image of each point to be visited then sort the values This idea has been used to build routing systems for commercial vehicles based only on Rolodex card files 4 A space filling curve is a continuous map of the unit interval onto a unit square and so a pseudo inverse maps the unit square to the unit interval One way of constructing a pseudo inverse is as follows Let the lower left corner 0 0 of the unit square correspond to 0 0 and 1 0 Then the upper left corner 0 1 must correspond to 0 25 the upper right corner 1 1 to 0 50 and the lower right corner 1 0 to 0 75 The inverse map of interior points are computed by taking advantage of the recursive structure of the curve Here is a function coded in Java that will compute the relative position of any point on the Sierpinski curve that is a pseudo inverse value It takes as input the coordinates of the point x y to be inverted and the corners of an enclosing right isosceles triangle ax ay bx by and cx cy The unit square is the union of two such triangles The remaining parameters specify the level of accuracy to which the inverse should be computed static long sierp pt2code double ax double ay double bx double by double cx double cy int currentLevel int maxLevel long code double x double y if currentLevel lt maxLevel currentLevel if sqr x ax sqr y ay lt sqr x cx sqr y cy code sierp pt2code ax ay ax cx 2 0 ay cy 2 0 bx by currentLevel maxLevel 2 code 0 x y else code sierp pt2code bx by ax cx 2 0 ay cy 2 0 cx cy currentLevel maxLevel 2 code 1 x y return code Representation as Lindenmayer system editThe Sierpinski curve can be expressed by a rewrite system L system Alphabet F G X Constants F G Axiom F XF F XF Production rules X XF G XF F XF G X dd Angle 45Here both F and G mean draw forward means turn left 45 and means turn right 45 see turtle graphics The curve is usually drawn with different lengths for F and G The Sierpinski square curve can be similarly expressed Alphabet F X Constants F Axiom F XF F XF Production rules X XF F F XF F XF F F X dd Angle 90Arrowhead curve editThe Sierpinski arrowhead curve is a fractal curve similar in appearance and identical in limit to the Sierpinski triangle nbsp Evolution of Sierpinski arrowhead curveThe Sierpinski arrowhead curve draws an equilateral triangle with triangular holes at equal intervals It can be described with two substituting production rules A B A B and B A B A A and B recur and at the bottom do the same thing draw a line Plus and minus and mean turn 60 degrees either left or right The terminating point of the Sierpinski arrowhead curve is always the same provided you recur an even number of times and you halve the length of the line at each recursion If you recur to an odd depth order is odd then you end up turned 60 degrees at a different point in the triangle An alternate constriction is given in the article on the de Rham curve one uses the same technique as the de Rham curves but instead of using a binary base 2 expansion one uses a ternary base 3 expansion Code edit Given the drawing functions void draw line double distance and void turn int angle in degrees the code to draw an approximate Sierpinski arrowhead curve looks like this void sierpinski arrowhead curve unsigned order double length If order is even we can just draw the curve if 0 order amp 1 curve order length 60 else order is odd turn 60 curve order length 60 void curve unsigned order double length int angle if 0 order draw line length else curve order 1 length 2 angle turn angle curve order 1 length 2 angle turn angle curve order 1 length 2 angle Representation as Lindenmayer system edit nbsp Like many two dimensional fractal curves the Sierpinski arrowhead curve can be extended to three dimensionsThe Sierpinski arrowhead curve can be expressed by a rewrite system L system Alphabet X Y Constants F Axiom XF Production rules X YF XF Y Y XF YF X dd Here F means draw forward means turn left 60 and means turn right 60 see turtle graphics See also edit nbsp Wikimedia Commons has media related to Sierpinski curve Hilbert curve Koch snowflake Moore graph Murray polygon Peano curve List of fractals by Hausdorff dimension Recursion computer science Sierpinski triangleReferences edit Weisstein Eric W Sierpinski Curve MathWorld Retrieved 21 January 2019 Dickau Robert M 1996 7 Two dimensional L systems Robert s Math Figures MathForum org Retrieved 21 January 2019 Platzman Loren K Bartholdi John J III 1989 Spacefilling curves and the planar traveling salesman problem Journal of the Association for Computing Machinery 36 4 719 737 doi 10 1145 76359 76361 Bartholdi John J III Some combinatorial applications of spacefilling curves Georgia Institute of Technology Archived from the original on 2012 08 03 Further reading editPeitgen H O Jurgens H Saupe D 2013 1992 Chaos and Fractals New Frontiers of Science Springer ISBN 978 1 4757 4740 9 Stevens Roger T 1989 Fractal Programming in C M amp T Books ISBN 978 1 55851 037 1 Retrieved from https en wikipedia org w index php title Sierpinski curve amp oldid 1186058682, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.