Skip to content

Latest commit

 

History

History
422 lines (334 loc) · 15.6 KB

DOCUMENTATION.md

File metadata and controls

422 lines (334 loc) · 15.6 KB

Fractage Documentation

Endpoints

All query parameters are optional.

Fractals

Cantor Dust

http://localhost:6060/cantor-dust

Parameters

  • iterations:
    • Definition: The number of iterations that should be displayed.
    • Type: Integer
    • Range: 0 to 25 inclusive.
    • Default: 5
  • color:
    • Definition: The color for drawing the boxes.
    • Type: Color
    • Default: random colors.

Sample

Image of a Cantor dust with 5 iterations

Cantor Set

http://localhost:6060/cantor-set

Parameters

  • iterations:
    • Definition: The number of iterations that should be displayed.
    • Type: Integer
    • Range: 0 to 25 inclusive.
    • Default: 5
  • line_height:
    • Definition: The height of each line.
    • Type: Integer
    • Range: 0 to 30 inclusive.
    • Default: 5
  • color:
    • Definition: The color for drawing the lines.
    • Type: Color
    • Default: random colors.

Sample

Image of a Cantor set with 5 iterations and a line height of 5

Hopalong

http://localhost:6060/hopalong

Parameters

  • resolution:
    • Definition: The resolution for each pixel.
    • Type: Integer
    • Range: 0 to 5,000 inclusive.
    • Default: 5
  • a:
    • Definition: The value of the variable $a$ in the hopalong function.
    • Type: Float
    • Default: 5
  • b:
    • Definition: The value of the variable $b$ in the hopalong function.
    • Type: Float
    • Default: 1
  • c:
    • Definition: The value of the variable $c$ in the hopalong function.
    • Type: Float
    • Default: 5
  • d:
    • Definition: The value of the variable $d$ in the hopalong function.
    • Type: Float
    • Default: 0
  • x:
    • Definition: The starting value of $x$ in the hopalong function.
    • Type: Float
    • Default: -1
  • y:
    • Definition: The starting value of $y$ in the hopalong function.
    • Type: Float
    • Default: 0
  • scale:
    • Definition: The scale of the image displayed.
    • Type: Float
    • Default: 5
  • type:
    • Definition: The type of hopalong to function to use.
    • Type: Enum
      • classic_bm -> The classic Barry Martin hopalong.
      • positive_bm -> The positive Barry Martin hopalong.
      • additive_bm -> The additive Barry Martin hopalong.
      • gingerbread_man -> The gingerbread man hopalong.
    • Default: classic_bm
  • color:
    • Definition: The color for coloring the pixels.
    • Type: Color
    • Default: random color.

Sample

Image of the classic Barry Martin hopalong with a resolution of 5, a = 5, b = 1, c = 5, x = -1, y = 0, and a scale of 5

Iterated Function System

http://localhost:6060/ifs

Parameters

  • variables:
    • Definition: The value of the variables $a$, $b$, $c$, $d$, $e$, $f$, and $probability$ for each set of the iterated function system of the functions $x_{n + 1} = ax_n + by_n + e$ and $y_{n + 1} = cx_n + dy_n + f$. The first 7 values belong to the first set, the next 7 values belong to the second set, and the $n^\mathrm{th}$ 7 values belong to the $n^\mathrm{th}$ set.
    • Type: A $7n$ array of Floats, where $n$ is an integer greater than $0$.
    • Default: 0.0,0.0,0.0,0.16,0.0,0.0,0.01, 0.2,-0.26,0.23,0.22,0.0,1.6,0.07, -0.15,0.28,0.26,0.24,0.0,0.44,0.07, 0.85,0.04,-0.04,0.85,0.0,1.6,0.85
  • x:
    • Definition: The horizontal displacement of the image. Can be overwritten by the focus parameter.
    • Type: Float
    • Default: 0
  • y:
    • Definition: The vertical displacement of the image. Can be overwritten by the focus parameter.
    • Type: Float
    • Default: 0
  • scale:
    • Definition: The scale of the image to display. Can be overwritten by the focus parameter.
    • Type: Float
    • Range:_ 0 to 50,000 inclusive.
    • Default: 1
  • focus:
    • Definition: Specifies if the points should be brought to the center of the image. Can overwrite the effect of the x, y, and scale parameters.
    • Type: Boolean
    • Default: true
  • iterations:
    • Definition: The number of points to draw.
    • Type: Integer
    • Range: 0 to 5,000,000,000 inclusive.
    • Default: 500,000
  • color:
    • Definition: The color for coloring the points in each set. This is used for giving the points a uniform color and can be overwritten by the colors parameter.
    • Type: Color
    • Default: random color.
  • colors:
    • Definition: The color for coloring each set of points. This is used for assigning a unique color to the points that belong under a set of variables. Invalid colors are ignored and a random colour is used as a replacement. A random colour is also assigned to a set if there are an insufficient number of colours for the set of variables that were specified.
    • Type: A comma-separated list of Colors.
    • Default: mahogany, mahogany, mahogany, mahogany

Sample

Image of an iterated function system that has been centered with 500000 iterations, variables 0.0,0.0,0.0,0.16,0.0,0.0,0.01, 0.2,-0.26,0.23,0.22,0.0,1.6,0.07, -0.15,0.28,0.26,0.24,0.0,0.44,0.07, 0.85,0.04,-0.04,0.85,0.0,1.6,0.85, and colors mahogany, mahogany, mahogany, mahogany

Julia Set

http://localhost:6060/julia-set

Parameters

  • iterations:
    • Definition: The maximum number of iterations that should be performed for each pixel.
    • Type: Integer
    • Range: 0 to 500,000 inclusive.
    • Default: 250
  • c:
    • Definition: The value of $c$ in the equation $z = z^2 + c$.
    • Type: Complex
    • Default: $-0.5 + 0.6i$
  • bail_out:
    • Definition: The value at which the series diverges.
    • Type: Float
    • Default: 2
  • region:
    • Definition: The region of the infinite plane to display.
    • Type: Rectangle
    • Default: -1.5, -1.5, 3, 3
  • type:
    • Definition: The type of series to display.
    • Type: Enum
      • classic: The classic Julia set. Values are generated from the series $z_{n + 1} = z_n^2 + c$.
      • lace: The lace Julia set. Values are generated from the series $z_{n + 1} = \frac{iz_n^{-3} + 1010}{ciz_n^{-6} + 3301z_n}$, where $i, i \in \mathbb{C}$ is a variable.
      • phoenix: The phoenix Julia set. Values are generated from the series $z_{n + 1} = z_n^2 + c + kz_{n - 1}$, where $k, k \in \mathbb{C}$ is a variable.
      • csin: Values are generated from the series $z_{n + 1} = c\sin(z_n)$.
      • ccos: Values are generated from the series $z_{n + 1} = c\cos(z_n)$.
      • ctan: Values are generated from the series $z_{n + 1} = c\tan(z_n)$.
      • abs_sin4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\sin^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_cos4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\cos^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_tan4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\tan^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_cot4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\cot^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_sinh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\sinh^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_cosh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\cosh^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_tanh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\tanh^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_asinh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\mathrm{asinh}^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_acosh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\mathrm{acosh}^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
      • abs_atanh4: Values are generated from the series $z_{n + 1} = \mathrm{abs}(\mathrm{atanh}^4(z_n)) + c$, where $\mathrm{abs}$ is calculated as $\mathrm{abs}(3) + \mathrm{abs}(-2)$ for the complex number $3-2i$.
    • Default: classic
  • variables:
    • Definition: A comma-separated list of variable assignments.
    • Type: A list of VariableAssignments.
    • Default: i=3+0i
  • color_palette:
    • Definition: The color palette for coloring the pixels.
    • Type: ColorPalette
    • Default: multi_colored

Sample

Image of a Julia set in the region -1.5, -1.5, 3, 3, with 250 iterations, c = -0.5 + 0.6i, and a bail out of 2

Mandelbrot Set

http://localhost:6060/mandelbrot-set

Parameters

  • iterations:
    • Definition: The maximum number of iterations that should be performed for each pixel.
    • Type: Integer
    • Range: 0 to 500,000 inclusive.
    • Default: 700
  • m:
    • Definition: The value of $m$ in $z_{n + 1} = z_n^m + z_0$.
    • Type: Float
    • Default: 2
  • bail_out:
    • Definition: The value for which $|z|$ belongs to the fractal pattern. $|z|$ must be less than $\mathrm{bail_out}^m$ for the value of $z$ to belong to the fractal pattern.
    • Type: Float
    • Default: 20
  • region:
    • Definition: The region of the infinite plane to display.
    • Type: Rectangle
    • Default: -2, -1.25, 3.25, 2.5
  • color_palette:
    • Definition: The color palette for coloring the pixels.
    • Type: ColorPalette
    • Default: orange_blue

Sample

Image of the Mandelbrot set in the region -2, -1.25, 3.25, 2.5, with 700 iterations, m = 2, and a bail out of 20

Newton Basin

http://localhost:6060/newton-basin

Parameters

  • iterations:
    • Definition: The maximum number of iterations that should be performed for each pixel.
    • Type: Integer
    • Range: 0 to 500,000 inclusive.
    • Default: 32
  • polynomial:
    • Definition: The equation whose solution is to be found using the Newton-Raphson method.
    • Type: Polynomial
    • Default: -1+x^5 ($-1+x^5$)
  • bail_out:
    • Definition: The value for which $|z|$ belongs to the fractal pattern. $|z|$ must be less than bail_out for the value of $z$ to belong to the fractal pattern.
    • Type: Float
    • Default: $1e15$
  • region:
    • Definition: The region of the infinite plane to display.
    • Type: Rectangle
    • Default: -2, -1.5, 4, 3
  • color_palette:
    • Definition: The color palette for coloring the pixels.
    • Type: ColorPalette
    • Default: A dynamic set of colors.

Sample

Image of the Newton basin of the polynomial -1+x^5 in the region -2, -1.5, 4, 3, with 32 iterations, and a bail out of 1e15

Sierpinski Carpet

http://localhost:6060/sierpinski-carpet

Parameters

  • iterations:
    • Definition: The number of iterations that should be displayed.
    • Type: Integer
    • Range: 0 to 25 inclusive.
    • Default: 5
  • color:
    • Definition: The color for drawing the boxes.
    • Type: Color
    • Default: random colors.

Sample

Image of a Sierpinski carpet with 5 iterations

Sierpinski Triangle

http://localhost:6060/sierpinski-triangle

Parameters

  • iterations:
    • Definition: The number of iterations that should be displayed.
    • Type: Integer
    • Range: 0 to 25 inclusive.
    • Default: 5
  • color:
    • Definition: The color for drawing the triangles.
    • Type: Color
    • Default: random colors.

Sample

Image of a Sierpinski triangle with 5 iterations

Type Definitions

Integer Type

Format: (+|-)?[0-9]+
Definition: A 64-bit signed integer.
Alias: <int>
Example: 768

Float Type

Format: (+|-)?[0-9]+(.[0-9]+)?
Definition: A 64-bit floating or fractional number.
Alias: <float>
Example: 7.68

Complex Type

Format: <float>([+-]<float>i)?
Definition: A complex number consisting of 64-bit floating point real and imaginary parts. If there's a sign, there should be no spaces around it.
Alias: <cmplx>
Example: 7.68+3i

Boolean Type

Format: (1|t|T|TRUE|true|True) for the value of true or (0|f|F|FALSE|false|False) for the value of false
Definition: A true or false value.
Alias: <bool>
Example: false

Color Type

Alias: <color>

Variant 1

Format: rgb(<int>, <int>, <int>) or rgba(<int>, <int>, <int>, <int>)
Definition: A color defined using the rgb or rgb format, where the <int> values are in the range 0-255 inclusive.
Example: rgb(125, 25, 35)

Variant 2

Format: #[0-9a-f]+
Definition: A color defined using the hexa-decimal format, where the values are integers in the range 0-255 inclusive but written in the hexa-decimal format.
Example: #2233aa or #23a

Variant 3

Format: [a-zA-Z_]+
Definition: A named color that has been defined in colors.yaml.
Example: slategray

Rectangle Type

Alias: <rect>

Variant 1

Format: <float>, <float>, <float>, <float>
Definition: 4 comma-separated float values representing the x position, y position, width and height of a rectangular area.
Example: 1.13, 2, 9.8, 7

Variant 2

Format: <float>, <float>
Definition: 2 comma-separated float values representing the width and height of a rectangular area. The x and y positions would be 0.
Example: 7.68, 7.86

Polynomial Type

Format: (<float>([a-zA-Z](^<int>)?)?)+
Definition: A simple polynomial expression.
Alias: <poly_expr>
Example: 3 + 2.3x - x^5 for $3 + 2.3x - x^5$

Color Palette Type

Alias: <color_palette>

Variant 1

Format: [a-zA-Z_]+
Definition: A named color palette that has been defined in color_palettes.yaml.
Example: orange_blue

Variant 2

Format: ("<color>", <float>,)+
Defininition: A comma-separated list of colors and positions in increasing order. Each position has to be a <float> type in the range of 0 to 1 inclusive. Colors defined using the rgb format should be enclosed in double quotes.
Example: slategray, 0.0, %23808080, 0.45, %22rgb(200, 200, 200)%22, 1.0