Hydrogen atom
I have been contemplating the animation framework and recently implemented a SPIN command to make spin animation easy for even young children. In order to show how to spin objects, I have created this hydrogen atom simulation to demonstrate the SPIN and a few new commands.
A hydrogen atom has one proton in the nucleus and one electron orbiting the nucleus. Below is only a simulation or visualisation. You can see the 3D animation is quite complex even there are just two spins (one directly on the orbit, and the other one on the parent coordinate transform).
; Hydrogen atom ; By Andy Yeh (2014) CS RESET SETBG 23 TRANSFORM ; create a coordinate group obj_0 for animation purpose later SETPARENT OBJECT ; make this coordinate group the parent of objects created after SETEC 0 0 1000 ; set emissive colour (blue) for orbit CIRCLE ; create a circle (r=1) as the orbit of electron obj_1 UP 1 ; move the turtle to the orbit SETSCALE .2 .2 .2 ; size for electron SETMAT 0 15 ; material for electron BALL ; create an electron obj_2 HOME SETPARENT "root ; leave the coordinate system SETSCALE .6 .6 .6 ; size of nucleus SETMAT 5 29 ; material for proton BALL ; create a proton at the center obj_3 SHOWALL ; bring everything to fit screen ; start animation from here ; the first spin is on obj_0. Because the electron is 1 meter away from the centre so ; it spins (tilt right) like orbiting the proton once every 4 seconds. SPIN "obj_0 "tiltright 4 ; next, I spin the orbit to the right direction once every 20 seconds. SPIN "obj_1 "right 20 ; enjoy the spin :-)
Please leave a comment below if any or discuss in the forum for animation questions.
- Andy's blog
- Login or register to post comments
- 5663 reads
Comments
Add movement to proton
I have also implemented two more animation commands called TRAVEL and ORIENT. You can find them in the Logo guides and references here https://vrmath2.net/content/logo-guidereference#sec6_15.
With the help of Nick, if you add the following codes to the above Logo program, the proton in the nucleus will start to "wiggle".
Enjoy wiggling!
hiwelcome to this education