Ultra Fractal: Switching within one formula

3 min read

Deviation Actions

StimpyKatz's avatar
By
Published:
1.3K Views
This is a small tutorial for people who want to write a
fractal formula for Ultra Fractal and want to use the
switch feature. As written in the help of UF, to switch
from a mandelbrot to a julia fractal you must write two
formulas.
Yesterday i found in the tma2.ufm formula (public
folder) a method to do that switching magic with only
one formula. The advantages: When you tweak your new
formula you don't need to make it twice. For long formulas
as e.g. in tma2.ufm this way of switching avoids messing
up the code:)
Now i present here a formula of mine, that i created yesterday:)

Here is an example fractal of this formula

a112 {; (c) by Thomas Michels alias StimpyKatz
;        Mail:thommichels@web.de
;This formular can switch to juliamode
;without needing to write a second formula
init:
  z=c=#pixel
  ; modeJ and modeM will be set in the
  ; switch section
  if modej == "Mandel"
   ;z = seed   ;optional settings for
   ;c = #pixel  ;mandel mode
  endif
  if modem == "Julia"
   z = pixel   ;Now julia mode is active
   c = seed
  endif
loop:
  z=fn1(z^2)*fn2(fn3(c)/fn4(z))+c
bailout:
|z|<4
default:
  title = "a112"
  param modeM  ;Mode holder
    caption="Switchmode"
    enum = "Mandel""Julia"
    default = 0
    enabled = false
  endparam
  param modeJ  ;Mode holder
    caption="Switchto"
    enum = "Mandel""Julia"
    default = 1
    enabled = false
  endparam
  func fn1
    caption="fn1(z^2)"
    default = ident()
  endfunc
  func fn2
    caption="fn2(fn3/fn4)"
    default = sin()
  endfunc
  func fn3
    caption="fn3(c)"
    default = ident()
  endfunc
  func fn4
    caption="fn4(z)"
    default = ident()
  endfunc
  param seed
    caption = "Seed"
    default = (1,0)
  endparam

switch:
  type= "a112"
  seed= #pixel
  modeJ=modem ;Everytime when switched occured
  modeM=modej ;values of modeM and modeJ will be
  fn1=fn1      ;exchanged.
  fn2=fn2
  fn3=fn3
  fn4=fn4
}

Please tweak this formula and share your ideas.
I would appreciate that:)
© 2009 - 2024 StimpyKatz
Comments5
Join the community to add your comment. Already a deviant? Log In
P.S.: The formula works fine with Ultra Fractal and also with Gnofract on my computer. It has no "4D", but enough parameters to loose orientation by other methods than 4D... ;-)