Browse Search Popular Register Upload Rules User list Login:
Search:
Sphere Compressor Script

Image:
screenshot of the scene

Author: GMtester

Group: Default

Filesize: 54.83 kB

Date added: 2015-06-08

Rating: 5

Downloads: 574

Views: 309

Comments: 7

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Please comment if the script is wrong in converting the circle's radius to area, then finding out 95 percent of it then converting it back to its radius.
(Only scripters will understand this...
"May the swag be with you"
To Physics Professors: If I was able to do this in real life, by compressing a sphere 5%, would its density increase 5%?
FIXED! its density would incrase 22.16067 %
Credit to Alex_Mercer for text script!
Last edited at 2015/06/09 01:28:46 by GMtester
Please log in to rate this scene
edit
Similar scenes
Title: The Garbage Compressor
Rating: 4
Filesize: 494.33 kB
Downloads: 5859
Comments: 6
Ratings: 5
Date added: 2010/11/03 21:36:51
Made with: Phun
Rating: rated 4
download
Title: Compressor
Rating: 4.5
Filesize: 44.12 kB
Downloads: 370
Comments: 1
Ratings: 2
Date added: 2009/01/21 19:10:39
Made with: Phun
Rating: rated 4.5
download
Title: Unnamed Event
Rating: 5
Filesize: 47.52 kB
Downloads: 1627
Comments: 3
Ratings: 1
Date added: 2023/04/26 20:46:01
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: water compressor
Rating: 5
Filesize: 0.86 MB
Downloads: 3523
Comments: 1
Ratings: 1
Date added: 2022/09/11 21:10:28
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: For Uglytopian's Adventure
Rating: 5
Filesize: 234.84 kB
Downloads: 345
Comments: 1
Ratings: 1
Date added: 2018/11/10 13:56:06
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: 3D Basketball
Rating: 6.8334
Filesize: 487.11 kB
Downloads: 2127
Comments: 12
Ratings: 6
Date added: 2010/03/03 20:15:08
Made with: Phun
Rating: rated 6.8
download
Rather than, n / 100 * 105
Simpler to do n * 1.05


Another suggestion is:
When C key is pressed, the code runs continuously, shrinking the circle's area by 5% many times per second. It is almost impossible to tap the C key to get just one shrink cycle. So, maybe add a little script that will only allow ONE 5% shrink cycle per keypress. User will then be able to see how much things have changed over just one iteration instead of over many.

Other than those picky things, you did a good job on the coding! :tup:
If "Every time to sphere is hit by a laser it is shrunk 5% of its area and its density is increased 5%", then its mass would not change. The circle's mass in this scene does change.

This works:
in onHitByLaser:
radius = radius * 0.95^0.5;
density = density/0.95;

Math:
A1 = 0.95 * A0
pi * r1^2 = 0.95 * pi * r0^2
r1 = (0.95 * r0^2)^0.5
r1 = r0 * 0.95^0.5

Q: If I was able to do this in real life, by compressing a sphere 5%, would its density increase 5%?
A: No, it would increase more than 5%.
Last edited at 2015/06/09 02:22:34 by s_noonan
I fixed the density
if a sphere was compressed 5% of its area it would have its density increased
22.16067% having its mass at a fixed point. DEAR SCIENTISTS, YOU CAN USE THIS RATIO! JUST CALL IT GMtester's ratio of circular/spherical compression!
Looks like you are going to have to study algebra and geometry a little harder. I gave you the answer above and will repeat it here for convenience:

in onHitByLaser:
radius = radius * 0.95^0.5;
density = density/0.95

The density increases by 1.0526 (=1/0.95). JUST CALL IT Basic Math! Feel free to use it in any of your scenes. The formulas relate to circles. Algodoo does not have spheres. Spheres would use a different formula.

Maybe I'm a little harsh on you by assuming you are familiar with algebra and geometry. At an rate, the scene's formula for radius is wrong. It appears that you assumed it was correct and then experimentally determined the corresponding factor for density. I guess that shows some creativity and ingenuity.
Last edited at 2015/06/09 22:15:34 by s_noonan
I'm only in 7th grade lol...
going to 8th grade...
Well, in that case, good work. :tup: I've been one of your subscribers for a while and am looking forward to seeing your new scenes.