3 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
source | link

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

You can find source herehere.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

You can find source here.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

You can find source here.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

    Tweeted twitter.com/StackCodeGolf/status/733166712653262848
2 Added link to code to generate example images
source | link

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

You can find source here.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

You can find source here.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9

1
source | link

Recursive Steiner Chains

Steiner Chains are a set of N circles where each circle is tangent to 2 other non-intersecting circles as well as the the previous and next circles of the chain, as seen in the below images:

Order 3 Order 5 Order 7

In this challenge, you will write a program/function that draws Steiner chains recursively, that is, circles of a given chain will be the base circles of another iteration of chains:

enter image description here

Challenge

Write a program/function that accepts image dimensions and a list of integers denoting the level of circles in each successive iteration of chains, and output an image with the recursive Steiner chains drawn to it.

Input

Your program/function will accept 2 arguments:

  • s - width and height of image
  • ls - list of positive integers denoting the number of circles present in each successive iteration of chains, ordered from the top-most chain to the bottom-most chain

Output

Your program/function will output an image of dimension s x s displaying the recusive Steiner chain.

  • The top level base circle will be as large as the image with a diameter of s, centered inside the image
  • To make things easy, the 2 base circles of a Steiner chain will be concentric, that is, the centerpoints of the 2 baseline circles will be the same
  • Given an outer radius, R, and the number of circles in a chain, N, the formula for the inner radius R' is R' = (R-R*sin(pi/N))/(sin(pi/N)+1)
  • Circles of the chain as well as the inner base circle will be the outer base circles of the next iteration of chains
  • While recursing through the chain circles, the order of the next chain should correspond to the next value in ls
  • While recursing through the inner circle of a chain, the order should be the same as its parents order (example [5,2]):
  • Order 5.2
  • All chains should end recursion at a depth of the length of ls
  • The rotation of the chains doesn't matter:
  • Rotation 1 Rotation 2
  • However, the rotations of recursive chains relative to their parents centerpoint should be the same:
  • Order 5.2 Invalid Order 5.2
  • All circles should be drawn with an outline or solid fill
  • Color choice is left to the implementation, save for loopholes (for example, filling everything with the same color)

Example Runs

In the following examples, color is determined by (depth of the recursion)^4.

chain(600,[5,4,3])

5.4.3

chain(600,[11,1,1,1,1,1,1])

11.1.1.1.1.1.1

chain(600,[5,6,7,8,9])

5.6.7.8.9