Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fractal flame
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Creating the histogram=== [[File:Apophysis-100303-104.jpg|thumb|right|A fractal flame.]] First, one iterates a set of functions, starting from a randomly chosen point ''P = (P.x,P.y,P.c)'', where the third coordinate indicates the current color of the point. :Set of flame functions: <math>\begin{cases} F_1(x,y), \quad p_1 \\ F_2(x,y), \quad p_2 \\ \dots \\ F_n(x,y), \quad p_n \end{cases}</math> In each iteration, choose one of the functions above where the probability that ''F<sub>j</sub>'' is chosen is ''p<sub>j</sub>''. Then one computes the next iteration of ''P'' by applying ''F<sub>j</sub>'' on ''(P.x,P.y)''. Each individual function has the following form: :<math>F_j(x,y) = \sum_{V_k \in Variations} w_k \cdot V_k(a_j x + b_j y +c_j,d_j x + e_j y +f_j)</math> where the parameter ''w<sub>k</sub>'' is called the weight of the '''''variation''''' ''V<sub>k</sub>''. Draves suggests <ref name="dravespdf">{{cite web|url=https://flam3.com/flame_draves.pdf|title=The Fractal Flame Algorithm}} {{small|(22.5 MB)}}</ref> that all <math>w_k</math>:s are non-negative and sum to one, but implementations such as Apophysis do not impose that restriction. The functions ''V<sub>k</sub>'' are a set of predefined functions. A few examples<ref name="dravespdf" /> are * V<sub>0</sub>(''x'',''y'') = (''x'',''y'') (Linear) * V<sub>1</sub>(''x'',''y'') = (sin ''x'',sin ''y'') (Sinusoidal) * V<sub>2</sub>(''x'',''y'') = (''x'',''y'')/(''x''<sup>2</sup>+''y''<sup>2</sup>) (Spherical) The color ''P.c'' of the point is blended with the color associated with the latest applied function ''F<sub>j</sub>'': : P.c := (P.c + (F<sub>j</sub>)<sub>color</sub>) / 2 After each iteration, one updates the histogram at the point corresponding to ''(P.x,P.y)''. This is done as follows: <syntaxhighlight lang="cpp"> histogram[x][y][FREQUENCY] := histogram[x][y][FREQUENCY]+1 histogram[x][y][COLOR] := (histogram[x][y][COLOR] + P.c)/2 </syntaxhighlight> The colors in the image will therefore reflect what functions were used to get to that part of the image.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)