View Full Version : Lorenz attractor - help
Im new propeller user and teaching basic programming
Is possible help me with basic FloatMath example ? specialy Lorenz attractor ?
(im using Arduino and any attractor programming not problem in arduino wire code)
Please help me - very very THANKS
Sorry my bad english
11-03-2010, 03:14 PM
There's nothing complicated about floating point programming on the Propeller. It's all function calls.
A := B + C
A := FAdd(B, C)
D := - E
D := FNeg(E)
If you have something more complex, you can either separate it out into individual operations or nest the functions calls.
A := (B + C) * (D - E)
A := FMul( FAdd( B, C ) , FSub( D, E ) )
Read the documentation that comes with the floating point library from the Propeller Object Exchange. It shows you the routines that come with each version of the library. FloatMath is written in Spin, so it's relatively slow. I recommend using one of the assembly language versions instead.
11-03-2010, 03:29 PM
I've attached a little more info on FloatMath.
Very thanks info and examples :-)
And little question - is possible convert floating value to integer ? (for controlling sound or lcd etc...)
example floating value 1.256
integer value 1256
not rounded like 1
11-03-2010, 03:52 PM
Absolutely, just multiply your fp number by 1000 in your case, and then truncate.
11-03-2010, 04:11 PM
That would be: FTrunc(FMul(1.256,1000.0))
My first working code :-)
Lorenz 3D fractal map and nokia 6100 lcd
Thanks previous help
Gingerbreadman fractal map