Logo by Pauldelbrot - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. October 14, 2019, 08:50:44 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: basic script/makro language?  (Read 1838 times)
Description: i am developing a basic language for generating formulas ....
0 Members and 1 Guest are viewing this topic.
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« on: March 26, 2008, 01:23:44 AM »

 :smiley

i am developing a little makro language for generating scripts within mutatorkammer, this is how far i am now:

Basic language:

@MAKRO = XX|YY... ==  XX|YY...

= Makro will be replaced with XX or YY or whatever, any length of alternations is possible
== is the final statement it means if MAKRO is in last iteration visible - use that, same syntax as for =

Uses The makro with %MAKRONAME%

built in functions:

randomTree(DEPTH)
generates a random Formul Tree of depth DEPTH

randomVal(min[max])
Creates a random value in between max and min


The Above is actually implemented, and i am using the following script as a global include:

 afro afro afro
Code:
@MK_SKRIPT
COMMENT AREA
@MK_MAKROS
@ZERO = 0
@ONE    = 1
@PI=#3.14159265358979323846264338327950288
@E=#2.71828182845904523536028747135266249
@SQROOT2=#1.41421356237309504880168872420969807
@SQROOT3=#1.73205080756887729352744634150587236
@EMASCH=#0.57721566490153286060651209008240243
@GOLDENRATIO=#1.61803398874989484820458683436563811
@PLASTIC=#1.32471795724474602596090885447809734
@EMBREE= #0.70258
@FEIGENBAUM1= #4.66920160910299067185320382046620161
@FEIGENBAUM2= #2.50290787509589282228390287321821578
@HUGHES= #0.050989
@MEISSELMERTENS= #0.26149721284764278375542683860869585
@CATALAN=#0.91596559417721901505460351493238411
@LANDAU= #0.76422365358922066299069873125009232
@VISWANATH= #1.13198824
@RAMAJUNSOLDNER= #1.45136923488338105028396848589202744
@IMAGINARY=#0#1

@RANDOMCONSTANT=%PI%|%E%|%SQRROOT2%|%SQRROOT3%|%EMASH%|%GOLDENRATIO%|%PLASTIC%|%EMBREE%|%FEIGENBAUM1%|%FEIGENBAUM2%|%HUGHES%|%MEISSELMERTENS%|%|%CATALAN%|%LANDAU%|%VISWANATH%|%RAMAJUNSOLDNER% |%IMAGINARY%


@TRIGONOMETRIC=SIN|COS|TAN|SEC|COSEC|COTAN
@INVERSETRIGONOMETRIC=ASIN|ACOS|ATAN|ASEC|ACOSEC|ACOTAN
@HYPERBVOLIC=SINH|COSH|TANH|SECH|COSECH|COTANH
@INVERSEHYPERBVOLIC=ASINH|ACOSH|ATANH|ASECH|ACOSECH|ACOTANH

@VARIABLE= $PIXEL|$SCREEN|$A|$B|$T|$C|$Z|$LASTZ|$W|$V|$ITERATION
@VARIABLECONST=$PIXEL|$SCREEN|$T|$LASTZ|$ITERATION|$V|$W
@VARIABLE=$A|$B|$C

@FUNCTION1= SIN|COS|FRAC|CELL|POW|EXP|RECIP|POLAR|CARTESIAN|ABS|NEG|REAL|IMAG|ASIN|ACOS|COSH|CONJ|ROUND|SINH|TAN|TANH|ATAN|NORM|LN|LOG10|SWAP|VECABS|SQRT|FLOOR|CEIL|SETW|SETV|FLAME_CROSS|IMAGE|SINUSOIDIAL|SPHERICAL|SWIRL|HORSESHOE|POLAROID|HANDKERCHIEF|HEART|ASINH|ACOSH|COTAN|COTANH|ACOTAN|ACOTANH|SEC|COSEC|ASEC|ACOSEC|SECH|COSECH|ASECH|ACOSECH|DIST_DIAMOND|DISC|TILE|SPIRAL|CYLINDER|HYPERBOLIC|DIAMOND|EX|FISHEYE|MAPTORGB|BENT|SQUARE|PERLIN|TURBULENCE
@FUNCTION2=MOD|MUL|VECMUL|ADD|XOR|AND|OR|PERSPECTIVE|SUB|PARABOLA|RINGS|PERLIN|TURBULENCE|BUBBLE|FLOWER|DIV|DOT|POW|AVG|MAX|MAXABS|MAXIMAG|MIN|FAN|MINIMAG|MINABS|SETW2|APFEL|BARNSLEY1|BARNSLEY2|ITERATE|LAMBDA|POPCORN
@FUNCTION3=PERLIN|TURBULENCE|VECTOR3|CLAMP|CURL|PDJ|MAPTORGB2|MAGNET1|MAGNET2|APFEL|BARNSLEY3|SPIDER|MANOWAR|HALLEY|LERP|WAVE|NEWTON|SUPER
@FUNCTION4=PHOENIX|IFLO|IFLOIMAG|IFLOABS|AFFIN|NOVA

@FRACTAL2=APFEL|BARNSLEY1|BARNSLEY2|ITERATE|LAMBDA
@FRACTAL3=  MAGNET1|MAGNET2|APFEL|BARNSLEY3|SPIDER|MANOWAR|HALLEY|NEWTON
@FRACTAL4=  PHOENIX|NOVA






a script may then look like this:
 cool cool cool
Code:

@MK_SKRIPT
@MK_MAKROS
@MAKRO1=$PIXEL
@MK_STARTSTRING
%FUNCTION2%(%MAKRO1%,randomvar(-2,2))


 i would like you to post any thoughts and suggestions what you think about it,  any suggestions, ideas and for sure a mathematical constant i missed so far  police


 afro


btw: did did you know that EACH function in the declarations above are currently build in into mutatorkammer v0.69x ?
 
« Last Edit: March 26, 2008, 01:36:57 AM by Trifox, Reason: adding more info... » Logged

---

divide and conquer - iterate and rule - chaos is No random!
Sockratease
Global Moderator
Fractal Senior
******
Posts: 3181



« Reply #1 on: March 26, 2008, 10:50:22 AM »

I like the idea of defining a range for values in a randomize command.  That will be useful, for sure.

I've never used a script in a fractal generator before, so it should prove interesting.

You listed functions I am unfamiliar with, so I'm not likely to have more to suggest, but if I think of any I'll post them!
Logged

Life is complex - It has real and imaginary components.

The All New Fractal Forums is now in Public Beta Testing! Visit FractalForums.org and check it out!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #2 on: March 26, 2008, 11:16:33 AM »

i think i will add another option:

@MAKRO(par1,par2,...) = X(par1)X(par2)|Y(par1)Y... ==  XX|YY...

so, adding a parameter object to makros  cheesy
Logged

---

divide and conquer - iterate and rule - chaos is No random!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #3 on: March 27, 2008, 02:44:59 AM »

 :gum:oh my god, this is becoming huge cheesy

skript language functions:

Code:
randomtree ( depth )
randomval( min,max )
New Added
Code:
breed(FORMULASTRING) -breeds FORMULASTRING with current breed window parameter settings
crossover(FORMULASTRING,FORMULASTRING2) - crossover FORMULASTRING with FORMULASTRING2 with current breed window parameter settings
variate(FORMULASTRING) - variates with current breed window parameter settings
eval(FORMULASTRING) - evaluates to a complex number ( constant #r#i )

Macro Definition:

MAKROS can have parameters and propabilities ( cstyle and overloading wink )
Logged

---

divide and conquer - iterate and rule - chaos is No random!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #4 on: March 27, 2008, 04:37:09 AM »

one example run:
Code:
// script 3
@MK_SKRIPT
@MK_MAKROS
@MAKRO1=ADD(randomtree(2),%FUNCTION2%(%VARI%,%MAKRO1%))|%MAKRO2%==$PIXEL

@MAKRO2=%FUNCTION1%(%MAKRO3%)==$PIXEL
@MAKRO3=%FRACTAL2%(%MAKRO1%,%MAKRO3%)|%VARI%=$PIXEL
@VARI=$PIXEL|$A|$B|$C|randomval(-2,2)
@MK_STARTSTRING
%MAKRO1%

ONE RESULT:
(compatible witrh current MK but renders slow with current version ... )
Code:
ADD(ASEC(ABS(VECMUL(#2.000000#2.000000,$PIXEL))),OR($B,ADD(ASEC(ABS(VECMUL(#2.000000#2.000000,$PIXEL))),MIN($C,ADD(ASEC(ABS(VECMUL(#2.000000#2.000000,$PIXEL))),PERLIN(VECMUL(#2.000000#2.000000,$PIXEL),ADD(ASEC(ABS(VECMUL(#2.000000#2.000000,$PIXEL))),FLOWER($C,ATAN(#0)))))))))

and some sample renderings of that formula:



* example1.png (246.49 KB, 400x400 - viewed 320 times.)

* example2.png (240.75 KB, 400x400 - viewed 383 times.)

* example3.png (177.09 KB, 400x400 - viewed 390 times.)
« Last Edit: March 27, 2008, 04:44:30 AM by Trifox » Logged

---

divide and conquer - iterate and rule - chaos is No random!
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #5 on: March 27, 2008, 07:57:34 AM »

that 2nd pic looks cool with the nice blue glow, good job!  afro
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
The secret language of nature Still Frame Sergio CT 0 381 Last post May 21, 2013, 11:29:57 AM
by Sergio CT
Mathematica and Wolfram language Free on raspberry pi Non-Fractal related Chit-Chat ker2x 0 1056 Last post May 23, 2014, 10:47:13 AM
by ker2x
programming language frequency generator Programming NYMAREK 1 857 Last post December 05, 2015, 08:06:26 AM
by ker2x
Mandelbulb3d v1.9.1 - Language bug reporting FracZky 2 609 Last post March 30, 2016, 11:41:38 PM
by thargor6

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.113 seconds with 28 queries. (Pretty URLs adds 0.009s, 2q)