How to embed an escape time formula into a c_var variation

Written by Thomas Michels

To make things easier, please load this flame into JWF

<flame name="z^2 + 1/Z + C" smooth_gradient="0" version="JWildfire V5.50 (21.12.2019)" size="160 160" center="-2.0003127203564053 0.00108067509773357" scale="56.862745098039206" rotate="0.0" filter="0.0" filter_type="GLOBAL_SHARPENING" filter_kernel="MITCHELL_SMOOTH" filter_indicator="0" filter_sharpness="4.0" filter_low_density="0.025" oversample="1" post_noise_filter="0" post_noise_filter_threshold="0.35" quality="2.0" background_type="SINGLE_COLOR" background="0.0 0.0 0.0" bg_transparency="0" fg_opacity="1.0" brightness="4.0" saturation="1.0" gamma="4.0" gamma_threshold="0.01" vibrancy="1.0" contrast="1.0" white_level="220.0" temporal_samples="1.0" cam_zoom="1.0" cam_pitch="0.0" cam_yaw="0.0" cam_roll="0.0" cam_persp="0.0" cam_xfocus="-2.0" cam_yfocus="0.0" cam_zfocus="0.0" cam_pos_x="0.0" cam_pos_y="0.0" cam_pos_z="0.0" cam_zpos="0.0" cam_dof="0.084" cam_dof_area="0.0" cam_dof_exponent="2.0" new_dof="1" low_density_brightness="0.24" balancing_red="1.0" balancing_green="1.0" balancing_blue="1.0" cam_dof_shape="BUBBLE" cam_dof_scale="1.0" cam_dof_rotate="0.0" cam_dof_fade="1.0" antialias_amount="0.05" antialias_radius="0.05" post_symmetry_type="NONE" post_symmetry_order="2" post_symmetry_centre_x="0.0" post_symmetry_centre_y="0.0" post_symmetry_distance="1.25" post_symmetry_rotation="6.0" frame="1" frame_count="300" fps="30" post_blur_radius="0" post_blur_fade="0.95" post_blur_falloff="2.0" zbuffer_scale="1.0" zbuffer_bias="0.0" zbuffer_filename="PRE_ZBUF" mixer_mode="OFF" grad_edit_hue_curve_enabled="false" grad_edit_hue_curve_view_xmin="-5" grad_edit_hue_curve_view_xmax="260" grad_edit_hue_curve_view_ymin="-5.0" grad_edit_hue_curve_view_ymax="260.0" grad_edit_hue_curve_interpolation="SPLINE" grad_edit_hue_curve_selected_idx="0" grad_edit_hue_curve_locked="false" grad_edit_hue_curve_point_count="12" grad_edit_hue_curve_x0="0" grad_edit_hue_curve_y0="14.166666666666659" grad_edit_hue_curve_x1="23" grad_edit_hue_curve_y1="16.451612903225804" grad_edit_hue_curve_x2="46" grad_edit_hue_curve_y2="245.89285714285717" grad_edit_hue_curve_x3="70" grad_edit_hue_curve_y3="17.499999999999993" grad_edit_hue_curve_x4="93" grad_edit_hue_curve_y4="25.50000000000001" grad_edit_hue_curve_x5="116" grad_edit_hue_curve_y5="26.562500000000057" grad_edit_hue_curve_x6="139" grad_edit_hue_curve_y6="112.32142857142857" grad_edit_hue_curve_x7="162" grad_edit_hue_curve_y7="144.93589743589743" grad_edit_hue_curve_x8="185" grad_edit_hue_curve_y8="57.325581395348834" grad_edit_hue_curve_x9="209" grad_edit_hue_curve_y9="18.88888888888889" grad_edit_hue_curve_x10="232" grad_edit_hue_curve_y10="14.655172413793105" grad_edit_hue_curve_x11="255" grad_edit_hue_curve_y11="14.166666666666679" grad_edit_saturation_curve_enabled="false" grad_edit_saturation_curve_view_xmin="-5" grad_edit_saturation_curve_view_xmax="260" grad_edit_saturation_curve_view_ymin="-5.0" grad_edit_saturation_curve_view_ymax="260.0" grad_edit_saturation_curve_interpolation="SPLINE" grad_edit_saturation_curve_selected_idx="0" grad_edit_saturation_curve_locked="false" grad_edit_saturation_curve_point_count="12" grad_edit_saturation_curve_x0="0" grad_edit_saturation_curve_y0="35.307692307692314" grad_edit_saturation_curve_x1="23" grad_edit_saturation_curve_y1="66.42857142857143" grad_edit_saturation_curve_x2="46" grad_edit_saturation_curve_y2="15.93750000000001" grad_edit_saturation_curve_x3="70" grad_edit_saturation_curve_y3="60.48837209302325" grad_edit_saturation_curve_x4="93" grad_edit_saturation_curve_y4="15.54878048780489" grad_edit_saturation_curve_x5="116" grad_edit_saturation_curve_y5="8.717948717948719" grad_edit_saturation_curve_x6="139" grad_edit_saturation_curve_y6="30.5128205128205" grad_edit_saturation_curve_x7="162" grad_edit_saturation_curve_y7="79.56" grad_edit_saturation_curve_x8="185" grad_edit_saturation_curve_y8="98.78378378378382" grad_edit_saturation_curve_x9="209" grad_edit_saturation_curve_y9="119.393063583815" grad_edit_saturation_curve_x10="232" grad_edit_saturation_curve_y10="123.25" grad_edit_saturation_curve_x11="255" grad_edit_saturation_curve_y11="27.46153846153846" grad_edit_luminosity_curve_enabled="false" grad_edit_luminosity_curve_view_xmin="-5" grad_edit_luminosity_curve_view_xmax="260" grad_edit_luminosity_curve_view_ymin="-5.0" grad_edit_luminosity_curve_view_ymax="260.0" grad_edit_luminosity_curve_interpolation="SPLINE" grad_edit_luminosity_curve_selected_idx="0" grad_edit_luminosity_curve_locked="false" grad_edit_luminosity_curve_point_count="12" grad_edit_luminosity_curve_x0="0" grad_edit_luminosity_curve_y0="97.5" grad_edit_luminosity_curve_x1="23" grad_edit_luminosity_curve_y1="136.0" grad_edit_luminosity_curve_x2="46" grad_edit_luminosity_curve_y2="143.0" grad_edit_luminosity_curve_x3="70" grad_edit_luminosity_curve_y3="107.50000000000001" grad_edit_luminosity_curve_x4="93" grad_edit_luminosity_curve_y4="81.99999999999999" grad_edit_luminosity_curve_x5="116" grad_edit_luminosity_curve_y5="117.0" grad_edit_luminosity_curve_x6="139" grad_edit_luminosity_curve_y6="117.0" grad_edit_luminosity_curve_x7="162" grad_edit_luminosity_curve_y7="62.50000000000001" grad_edit_luminosity_curve_x8="185" grad_edit_luminosity_curve_y8="199.5" grad_edit_luminosity_curve_x9="209" grad_edit_luminosity_curve_y9="86.5" grad_edit_luminosity_curve_x10="232" grad_edit_luminosity_curve_y10="135.0" grad_edit_luminosity_curve_x11="255" grad_edit_luminosity_curve_y11="97.5">
  <xform weight="0.5" color_type="DIFFUSION" color="0.0" symmetry="0.0" mirror_pre_post_translations="0" material="0.0" material_speed="0.0" mod_gamma="0.1" mod_gamma_speed="0.0" mod_contrast="2.0" mod_contrast_speed="0.0" mod_saturation="0.5" mod_saturation_speed="0.0" mod_hue="-0.01" mod_hue_speed="0.0" c_var="0.452" c_var_fx_priority="0" c_var_shiftX="-0.0" c_var_shiftY="0.0" c_var_mode="0" c_var_zoom="-0.6600000000000001" c_var_code="696D706F7274206A732E676C736C2E766563323B0A7075626C6963207665633220662876656332207A290A7B0A0A20202F2F207A5E32202B20312F7A202B20630A20202076656332207A703D635F706F77287A2C322E30293B0A20202076656332207A763D635F696E76287A293B0A202020766563322063633D6E65772076656332282E37352C2D302E3130293B0A20202072657475726E20635F616464287A702C20635F616464287A762C20636329293B20200A20202F2F202072657475726E20635F6D756C28612C62293B0A0A20202F2F2072657475726E20635F657870287A293B0A0A20202F2F2072657475726E20635F6C6F67287A2C31302E30293B0A0A20202F2F2072657475726E20635F73717274287A293B0A0A20202F2F2072657475726E20635F706F77287A2C2D322E30293B0A0A20202F2F2072657475726E20635F73696E287A293B0A0A20202F2F2072657475726E2073696E68287A293B0A0A20202F2F2072657475726E20635F636F73287A293B0A0A20202F2F2072657475726E20635F73696E68287A293B0A0A20202F2F2072657475726E20635F636F7368287A293B0A0A20202F2F2072657475726E20636F7368287A293B0A0A20202F2F2072657475726E20635F61636F73287A293B0A0A20202F2F2072657475726E20635F6173696E287A293B0A0A20202F2F2072657475726E20635F6174616E287A293B0A0A20202F2F2072657475726E2074616E68287A293B0A0A20202F2F207665633220706F773D6E65772076656332282D2E3835302C2D2E3630293B0A20202F2F2072657475726E20635F706F77287A2C706F77293B0A0A20202F2F2072657475726E20635F636F6E6A287A293B0A0A20202F2F2072657475726E20635F696E76287A293B2F2F20202020766563322063633D6E65772076656332282E37352C2D302E3130293B0A2F2F202020207A3D635F616273287A293B0A2F2F202020207665633220643D635F706F77287A2C322E30293B0A2F2F2020202072657475726E20635F61646428642C6363293B20200A20202F2F7665633220613D635F61646428635F696E76287A292C635F65787028635F696E76287A2929293B0A20202F2F72657475726E20635F61646428612C635F657870286E6577207665633228302E302C20302E302929293B0A7D" post_mirror_wf="0.0" post_mirror_wf_fx_priority="1" post_mirror_wf_xaxis="1" post_mirror_wf_yaxis="1" post_mirror_wf_zaxis="0" post_mirror_wf_xshift="-0.0" post_mirror_wf_yshift="0.0" post_mirror_wf_zshift="0.0" post_mirror_wf_xscale="1.0" post_mirror_wf_yscale="1.0" post_mirror_wf_xcolorshift="0.0" post_mirror_wf_ycolorshift="0.0" post_mirror_wf_zcolorshift="0.0" post_point_symmetry_wf="0.412" post_point_symmetry_wf_fx_priority="1" post_point_symmetry_wf_centre_x="-2.0" post_point_symmetry_wf_centre_y="0.0" post_point_symmetry_wf_order="6" post_point_symmetry_wf_colorshift="0.0" dc_fractcolor="1.236" dc_fractcolor_fx_priority="0" dc_fractcolor_randomize="5" dc_fractcolor_time="1794.0" dc_fractcolor_xPar="0.442519863614471" dc_fractcolor_yPar="0.852258409676226" dc_fractcolor_Iters="12" dc_fractcolor_zoom="1.0" dc_fractcolor_ColorOnly="1" dc_fractcolor_Gradient="2" dc_fractcolor_z_scale="0.0" dc_fractcolor_z_offset="0.0" dc_fractcolor_reset_z="1" coefs="-0.5378247069877111 0.3719601128009793 -0.3719601128009793 -0.5378247069877111 -0.6714819747896499 1.2143242133360714" chaos="1.0"/>
  <palette count="256" format="RGB">
BFBF89B1B38BA4A88D9CA187959B8275795F6B684D5C553B52453347362A463027472D23
512C215C342D673D39755448846851876E548C7558988760A69668B49E6AB39D6CB39D6F
B59D70B79D72B89D72BA9F72B6A476B4A478B2A57CAFA680ACA984AAAA8BA2A791A4AEA5
AAB6B2AFC3BCB4C2BCBAC3BEB9BBB3BCB8AAB7B3A3B3AF9DA59C969F918F99888B938794
8C869886839982819A84829F8182A07D839A7F808D817B7E7E76777D7671746C5E6A5D53
62453765463167472C714E307A53367C55367F58377E603A876A439080568D82618A856D
91906E95986E98A0739CA3779998778D8E668184567A7B5073734A666042585235504B28
4C452048421C45411C44401C45401D48421E4842274B48355F5E546D6D677B7B7C828485
8B8E8F9AA29CA4AEA6A7B3B0AAB5B0A6B4B0A1AFB19DA8B1949EB28E96AE8D97A88C95A8
8895A085939682908D828E89818D847E887E81847C8181787F81788088847E88847C8884
7586816E877F6C837B6B7B706E755B7D7D52857D4A867B4686784281733B7D7235776B32
6B5E3154564453584A545F515E69635E7A796C8C8B7EA49D93B7AF94B6AD95B6AB97BAAD
97B8AB8EADA68798937B837D6E6C6C5149574C424F473B483D28383B1F3A341D3E302543
282C46292E482B2F4B30355731395F303C5D373C5740425B4F4868494B715B547567627A
796E878180999293A6A1A7AEAFB8AAB2BBA7B5BEA6BDC5A7C7CDA6D0D4A3D1D8A2D1DAA4
DADEAAE1DFABD8DEAFCBE1B3C6E6B5C5DDB5BED6B2B6D2B3B2CEC0A5BDB997A4A8858798
74718F635C7E564C6C4B385A412D4B3C283B392B2F3D2F2B3F3427433D214844204E4923
514D21545221615A2677672D8C742F9C8330AD8F35C1963DD09D41DAA342D8A247D1A34C
C59F51C2A558C3A760C1AF6CBEB579BEBE81C6C384CDC883D2C586D2C085D3BE7CD4B96F
D5B362D4AB5BD2A750D1A34CCB9D4AC2964FB99352B4935AAE9668A69477A296849E9888
9A9D8E8D8E81857F72756C5D796D5A614A2E61462761432174542686652B8D6C2E947430
B49157BDA466C6B774C2BA7E  </palette>
</flame>

Click on Transformations Tab and then on the small gear at the c_var variation to open the code editor.

How to Translate a formula e.g. z=z^2 + 1/z + c into Java code:

import js.glsl.vec2;
public vec2 f(vec2 z)
{
// z^2 + 1/z + c
vec2 zp=c_pow(z,2.0); //z*z
vec2 zv=c_inv(z); //1/z
vec2 cc=new vec2(.75,-0.10); //c.x=0.75, c.y=-0.10
return c_add(zp, c_add(zv, cc));//add the values like in the formula
} //and return z back to JWF

Documentation on C_var by Jesus Sosa

Link to a bunch of escape time formulas:

 

Leave a Comment