|
Post by tenochtitlanuk on Nov 3, 2022 17:15:38 GMT -5
Happened on this on Wolfram Mathworld and just had to code it in LB! Code'll be on my website if you can't code polar coordinates!
|
|
|
Post by tenochtitlanuk on Oct 27, 2022 12:20:46 GMT -5
Did you follow the ReadMe 'alphaTestNotes.txt'?
What Pi OS do you have installed?
=== Raspberry Pi ===
Extract the lb5-353 folder to your home folder. cd to ~/lb5-353 Raspberry Pi - Use the rpi32-353 file: ./rpi32-353 lb5alpha.im
|
|
|
Post by tenochtitlanuk on Oct 19, 2022 14:21:10 GMT -5
Animated gif of result.. Looks better run in LB of course!
|
|
|
Post by tenochtitlanuk on Oct 18, 2022 16:08:20 GMT -5
We are coming up to the Fifth of November, when Brits celebrate with fire and fireworks. It has usually-forgotten origins in an attempt to overthrow a king ( hurray!) or Parliament ( Boo!) or Catholicism- but even further back in ancient autumn season celebrations. I decided to throw together a seasonal animation- set fire to a fuse which wanders round the screen but never crosses itself, and finally detonates. And use my own LB/JB fill routines so it would run on each platform, rather than the dll route.
Draw by hand a single-pixel wide trace in black on a near-black background without crossing- almost impossible 'cos you can't see the track. So, at first, use a colour like red. Yup, nice wiggly trace to the centre. Start a fill- and find it stops at some random place. Try drawing a 2-pixel trace. Now it stops somewhere and goes back to the reds it missed on its curtailed path! Do a bit of thinking and screen-magnifying.Ahah! It's a problem when you HAVE to fill diagonally. Von Neumann or Moore neighbourhoods to any one familiar with the Game of Life. So -rewrite my fill to include diagonal steps as well as vertical/horizontal. Nearly right- but there is still a hidden problem, especially if you allow thicker parts of the fuse... anyway..... here's a Zip file file which is a working version. Not optimised- I wanted a slow fuse! PS The zipfile name is a tribute to a song of my youth- dedicated to the downtrodden and oppressed of Watts and other ghettos...
|
|
|
atan2
Sept 26, 2022 11:45:30 GMT -5
Post by tenochtitlanuk on Sept 26, 2022 11:45:30 GMT -5
Just a nice graphic to confirm I CAN draw arcs reliably! Shades of Sauron's eye, with hgv colouring. This example was created with the arc-ends and radial centre marked. Wihout them and with more arcs drawn you get a smoother but less dramatic pic! This thread also led me to examine the dot.product method. Thanks, friends..
|
|
|
atan2
Sept 23, 2022 6:55:03 GMT -5
Post by tenochtitlanuk on Sept 23, 2022 6:55:03 GMT -5
Many of us have found atan2, which takes variables y and x and gives an angle, to be very useful. I know I've coded it myself, and seen/used versions by Chris Iverson /Anatoly /B+ /Steelweaver /Rod /etc. Trouble is it is only needed infrequently. Recently, playing with arcs, I realised there are two common algorithm /definition versions in circulation. Checking on wikipedia- atan2 I find there is little consistency across programming languages. Up to 8 versions can be considered to exist, depending on whether you regard angles as being measured clockwise or anti-clockwise, and from which axis/direction regarded as zero. And you can define atan2 as giving results in the range 0 to 2 pi, or from -pi/2 to +pi/2!! No wonder I've sometimes got weird results and had to do a bit of fiddling! Just another symptom of my aging brain!
|
|
|
Post by tenochtitlanuk on Sept 17, 2022 11:10:03 GMT -5
The double-spacing of the OP's code is an artefact that occurs if you cut/paste code from LB editor to the Forum. Especially if you mix Linux line ends and Windows line-ends. ) CR/LF or CR or LF are all used by different systems. The '_' expects the next line to immediately follow, not after an empty line, so it's not a LB bug.
Titus ( bluatigro) produces interesting code, but has a major vision problem, and English as a second language. Like you I suspect, I use spacing and indenting a lot to make code easier to follow. It is very different and difficult for the OP.
His contributions to the forums has been valued and has several times inspired me.
|
|
|
Post by tenochtitlanuk on Sept 10, 2022 11:28:06 GMT -5
Remids me of what I remember of the Sixties... perhaps the contra-rotating one will help you unwind...
|
|
|
Post by tenochtitlanuk on Sept 9, 2022 17:48:12 GMT -5
One of those fun things which take rather longer than you expect! Saw on the 'net an animation that is basically like a Moire pattern- two overlapping fans rotating. Screen grab ( static) below.
My immediate thought was to generate one 'fan'... ... and then superpose a second one using Xor drawing. Then repeat at various phases. BUT I'D FORGOTTEN- LB's xor-plotting doesn't work when you drawbmp an image onto a graphic window! So I tried it making each fan blade with LINES drawn by me via the Bresenham routine previously on Forum. Result- not surprisingly when you think about it- was messy and incorrect.. Then the light dawned. Result as below. Have put the code on my websitePS You can of course CONTRArotate the two 'fans'. As above both are clockwise. PS Don't stare at this too long!!
|
|
|
Post by tenochtitlanuk on Sept 3, 2022 16:27:42 GMT -5
Pretty easy to find....
|
|
|
Post by tenochtitlanuk on Aug 22, 2022 4:46:58 GMT -5
Could not resist coding a 'recreation' of a Dekatron Geiger counter- just love the neon glow. If you run it, the Dekatrons step at random intervals and you hear the 'click' Once past one thousand the electromechanical counter copes. I havent run it up to the available full 9 digit display- I'll be long-dead before it gets there! Will put a page on my website in the next couple of days. EDITDekatron Counter.
|
|
|
Post by tenochtitlanuk on Aug 19, 2022 8:36:44 GMT -5
Unfortunately the MCI calls don't work for me under Linux/Wine.
re Rod's comments in JB Forum- I'll certainly be playing with the wav-file being repeatedly created and used. In my experience audio clicks always are a decaying sin wave. Only the original electronic signal is a single logic-level pulse.
Incidentally we're heading towards a Geiger 'ratemeter'. A 'radiometer' was a lightweight paddle wheel that rotated when you shone a light on its vanes, whech were black on one side and white/silvered on the other, via heating effects and ( possibly) photon momentum effects.
|
|
|
Post by tenochtitlanuk on Aug 14, 2022 7:06:31 GMT -5
|
|
|
Post by tenochtitlanuk on Aug 11, 2022 10:54:43 GMT -5
I'm still playing with arcs and LB's colour graphics.... will add a web page soon.
|
|
|
Post by tenochtitlanuk on Aug 11, 2022 10:50:25 GMT -5
I found the lsn file to be really useful part unique to LB back when I was teaching. See Diga Me- lsn files
|
|