- #1
ArielGenesis
- 239
- 0
i think that the reason of hot water 'float' on the cold water is not becuase of diffrent density. i make a model of a container containing a higher energy particle (hot water) and lower energy particle (cold water) using action script in flash and uploaded it in geocities. www.geocities.com/arian_m3/heat.swf
from that, it shows that the hot water is MORE (not placed) at the top because it got the power to. while the cold water STAYS (not sink) at the bottom. And thus RESULTING (not beacuse of) a diffrent density. this might not be a perfect model of hot and cold water, but i couldn't find any better yet. the main concept of the script is to move the particle randomly and pulled it downward with gravity.
here is the code if anyone getting interested.
for the hotter particle:
onClipEvent (load) {
_x = 150;
_y = 300;
var vx = random(30)-random(30);
var vy = random(30)-random(30);
var i = 60;
if (_name == "red") {
while (i<>90) {
duplicateMovieClip(_root.red, "red"+i, i);
_parent["red"+i]._x = _x+random(50)-random(50);
_parent["red"+i]._y = _y+random(50)-random(50);
i++;
}
}
}
onClipEvent (enterFrame) {
vx += random(8)-random(8);
vy += random(8)-random(8)+1;
if (_x+vx<=10 or _x+vx>=400) {
vx *= -0.5;
}
if ( _y+vy>=590) {
vy *= -0.5;
}
_x += vx;
_y += vy;
}
and this one is for the colder particle
onClipEvent (load) {
_x = 200;
_y = 300;
var vx = random(10)-random(10);
var vy = random(10)-random(10);
var i = 0;
if (_name == "blue") {
while (i<>50) {
duplicateMovieClip(_root.blue, "blue"+i, i);
_parent["blue"+i]._x = _x+random(50)-random(50);
_parent["blue"+i]._y = _y+random(50)-random(50);
i++;
}
}
}
onClipEvent (enterFrame) {
vx += random(5)-random(5);
vy += random(5)-random(5)+1;
if (_x+vx<=10 or _x+vx>=400) {
vx *= -0.5;
}
if ( _y+vy>=590) {
vy *= -0.5;
}
_x += vx;
_y += vy;
}
feel free to fix my error.
from that, it shows that the hot water is MORE (not placed) at the top because it got the power to. while the cold water STAYS (not sink) at the bottom. And thus RESULTING (not beacuse of) a diffrent density. this might not be a perfect model of hot and cold water, but i couldn't find any better yet. the main concept of the script is to move the particle randomly and pulled it downward with gravity.
here is the code if anyone getting interested.
for the hotter particle:
onClipEvent (load) {
_x = 150;
_y = 300;
var vx = random(30)-random(30);
var vy = random(30)-random(30);
var i = 60;
if (_name == "red") {
while (i<>90) {
duplicateMovieClip(_root.red, "red"+i, i);
_parent["red"+i]._x = _x+random(50)-random(50);
_parent["red"+i]._y = _y+random(50)-random(50);
i++;
}
}
}
onClipEvent (enterFrame) {
vx += random(8)-random(8);
vy += random(8)-random(8)+1;
if (_x+vx<=10 or _x+vx>=400) {
vx *= -0.5;
}
if ( _y+vy>=590) {
vy *= -0.5;
}
_x += vx;
_y += vy;
}
and this one is for the colder particle
onClipEvent (load) {
_x = 200;
_y = 300;
var vx = random(10)-random(10);
var vy = random(10)-random(10);
var i = 0;
if (_name == "blue") {
while (i<>50) {
duplicateMovieClip(_root.blue, "blue"+i, i);
_parent["blue"+i]._x = _x+random(50)-random(50);
_parent["blue"+i]._y = _y+random(50)-random(50);
i++;
}
}
}
onClipEvent (enterFrame) {
vx += random(5)-random(5);
vy += random(5)-random(5)+1;
if (_x+vx<=10 or _x+vx>=400) {
vx *= -0.5;
}
if ( _y+vy>=590) {
vy *= -0.5;
}
_x += vx;
_y += vy;
}
feel free to fix my error.