Two masses and a spring v3

user_icon Canthiar shared it 1 year, 2 months ago
2272 views, 38 people love it, 2 taggers, 206 downloads, in 4 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

blackhawk blackhawk 2 weeks, 4 days ago

cul

(view all replies)
Comment Reply

alan_x alan_x 1 month ago

nice. if your interested in the enigma of physics check out this project. it simulates some really strage concepts... (link to project)

(view all replies)
Comment Reply

mpa1212 mpa1212 1 month, 1 week ago

cool

(view all replies)
Comment Reply

inuwali inuwali 2 months, 1 week ago

Like, like like! The physics is great stuff, and all the options make for some cool experiments. Well done.

(view all replies)
Comment Reply

iceprincess9021 iceprincess9021 2 months, 4 weeks ago

hmmmm

(view all replies)
Comment Reply

GodzGirl GodzGirl 5 months, 1 week ago

try this- it's cool!! (do it all at the same time) set gravity to -50 set air resistence to 0 set friction to 1 set restitution to 1 set spring length to 0 set spring costant to 2.1

(view all replies)
Comment Reply

Zachman Zachman 6 months ago

boring

(view all replies)
Comment Reply

Canthiar Canthiar 7 months, 2 weeks ago

It wasn't a matter of not being able to, it was to be consistent with Scratch's coordinate system.

(view all replies)
Comment Reply

Lucario621 Lucario621 7 months, 2 weeks ago

Well you could do "change y by -1 x gravity variable". You know, -1 multuplied by anything is changing it from positive to negative or other way around. I use it in my calculator!

(view all replies)
Comment Reply

Canthiar Canthiar 8 months, 3 weeks ago

That depends on your reference. Since Scratch uses positive as up I allowed the sign of the value to denote that positive is up and negative is down.

(view all replies)
Comment Reply

Lucario621 Lucario621 8 months, 3 weeks ago

Ya you did it wrong, it is sopposed to be the higher the gravity the lower it goes.

(view all replies)
Comment Reply

Kaleh Kaleh 8 months, 3 weeks ago

Nice, reminds me of an old game, E-motion

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 2 weeks ago

BATzerk: Newton's method is used for a wide range of calculus approximations. The specific one that I mentioned was Newton-Raphson that was used to calculate a square root. I only did that because at the time I didn't know the ins and outs of scratch and could have done that part with a "distance to" block.

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 2 weeks ago

BATzerk: The only thing that makes this seem complicated is because I expose a lot of variables. It's also a little confusing because two of the alter how the balls bounce off of the side of the screen.

(view all replies)
Comment Reply

BATzerk BATzerk 9 months, 2 weeks ago

ALSO--(sorry for totally posting so much, haha! I'm just an avid fan of your projects!)--the whole "I want to get the square root of something" was also something that bugged ME. Until I realized I loved calculus and made this: (link to project). Is this similar to how you did it? (Idk; I used Newton's method thingy, and I heard you mention something about Newton. I assumed this was the only way to calculate square roots in Scratch... apparently not...) And I'll just finish this off by saying that YOUR PROJECTS ARE AMAZING!! XD

(view all replies)
Comment Reply

BATzerk BATzerk 9 months, 2 weeks ago

As for the velocities of the balls being affected by mouse movement, I recently created a little simulation to do just that. (link to project) ...And I'll also be honest when I say I REALLY don't get how you make spring constant and spring length SEPARATE entities. Maybe I'll try and make my own some day with those variables... (if I can...)

(view all replies)
Comment Reply

BATzerk BATzerk 9 months, 2 weeks ago

Simply spectacular. Check this out: (link to project). I created it from scratch (as in without first analyzing the code of this project, which is phenominal, as you know, by the way); it's a much more simplified version of this. I also created a 3D version, which I'm currently working on finalizing... it's a bit laggy, so I'm worried about how it'll run on the site...

(view all replies)
Comment Reply

Canthiar Canthiar 9 months, 3 weeks ago

I don't mind.

(view all replies)
Comment Reply

Bloing_Gloing Bloing_Gloing 9 months, 3 weeks ago

Canthiar, this looks like a great base for a game. Mind if I use it in one?

(view all replies)
Comment Reply

bigreader bigreader 10 months, 1 week ago

Wow.

(view all replies)
Comment Reply

bigreader bigreader 10 months, 1 week ago

Wow. No, I mean really wow. As in like, wowwowwowwowwow.

(view all replies)
Comment Reply

kan kan 11 months, 1 week ago

its just weird u got all these ideas and intell inside 1 little brain!!!

(view all replies)
Comment Reply

kan kan 11 months, 1 week ago

Cool.

(view all replies)
Comment Reply

seville seville 11 months, 2 weeks ago

Incredible workings with science. Hands together for you again!

(view all replies)
Comment Reply

MESclan MESclan 11 months, 2 weeks ago

THIS IS AWESOME!!!!!!

(view all replies)
Comment Reply

Canthiar Canthiar 1 year ago

Restitution and friction describe the surface. Restitution is bounciness. Friction is scratchiness.

(view all replies)
Comment Reply

Babygirl Babygirl 1 year ago

u use hard words and i have NO IDEA what ur talkin about?!

(view all replies)
Comment Reply

lozzamon626 lozzamon626 1 year ago

daniepeep dont worry youll understand when you are my age cos i've dun it in class. i'm 11 yrs old...

(view all replies)
Comment Reply

lozzamon626 lozzamon626 1 year ago

its cool

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 1 month ago

DaniePeep, friction slows down the movement touching one of the sides. The spring constant is how strong the spring is.

(view all replies)
Comment Reply

DaniePeep DaniePeep 1 year, 1 month ago

What do friction and constent mean? I'm only 6!

(view all replies)
Comment Reply

MyRedNeptune MyRedNeptune 1 year, 1 month ago

Wow! This is the best phisic/science simulation ever!

(view all replies)
Comment Reply

maggie maggie 1 year, 1 month ago

coooooooooooooooooool.

(view all replies)
Comment Reply

Bingo_324 Bingo_324 1 year, 1 month ago

YOU DA MAN! this is one of the best programs I have ever seen. Editing Earth gravity is cool!

(view all replies)
Comment Reply

Mick Mick 1 year, 1 month ago

That is SO cool!!!!

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 1 month ago

The code can be a bit hard to follow since I put a Newton-Raphson integrator in the middle of the program to calculate square roots. It's mostly just simple physics calculations for force, acceleration, velocity, and displacement. I've always loved the simplicity of Newtonian physics.

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 1 month ago

Whoa, I can't believe I had a program that made it into the featured projects section. I appreciate all of the comments. I had really thought about adding more variables such as ball mass, spring dampening, compression spring constant, tension spring constant, and velocity based on mouse movement.

(view all replies)
Comment Reply

zippzom zippzom 1 year, 1 month ago

the programming is all greek to me

(view all replies)
Comment Reply

archmage archmage 1 year, 1 month ago

Wow. Nice use of physics and math. This is the most impressive program I have seen so far in scratch!

(view all replies)
Comment Reply

blood_elf blood_elf 1 year, 1 month ago

this is the best fing like that I have ever seen

(view all replies)
Comment Reply

purplefromossett purplefromossett 1 year, 1 month ago

How do you do that, changing the physics and everything? I have never seen anything like that on Sctratch 1.1. Where do you find all this?

(view all replies)
Comment Reply

Crusader6 Crusader6 1 year, 1 month ago

wow

(view all replies)
Comment Reply

blood_elf blood_elf 1 year, 1 month ago

this is so cool im adding it to my favorites

(view all replies)
Comment Reply

cairparavel cairparavel 1 year, 1 month ago

This is great. Load to experiment with and discover.

(view all replies)
Comment Reply

Zeberman Zeberman 1 year, 1 month ago

Sweet. Heres someone who pays attention in his physics lessons!

(view all replies)
Comment Reply

mohlar mohlar 1 year, 1 month ago

Anyone who dismisses Scratch as having no use beyond simple animations needs to see this program. Fascinating fun physics. Excellent

(view all replies)
Comment Reply

fandebiao fandebiao 1 year, 1 month ago

good job

(view all replies)
Comment Reply

supersteph supersteph 1 year, 1 month ago

good jod i love it

(view all replies)
Comment Reply

orenz orenz 1 year, 1 month ago

this is great, well done!

(view all replies)
Comment Reply

andresmh andresmh 1 year, 1 month ago

Impressive.

(view all replies)
Comment Reply

1000Master 1000Master 1 year, 2 months ago

Brilliant game. Shows a lot of science. I like science!

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 2 months ago

Thanks. I always like making programs that are more toy than functional. Responsiveness and ease of use always makes the programs just a little bit more fun to play with.

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 2 months ago

Thanks. I always like making programs that are more toy than functional. Responsiveness and ease of use always makes the programs just a little bit more fun to play with.

(view all replies)
Comment Reply

barnes barnes 1 year, 2 months ago

Wow, thats pretty awesome. Physics simulation in a simple drag and drop format. Awesome work!

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 2 months ago

I've inlined the square root calculation so the simulation runs much faster. Adjust delta time to set the coarseness of the calculations.

(view all replies)
Comment Reply

Canthiar Canthiar 1 year, 2 months ago

I've inlined the square root calculation so the simulation runs much faster. Adjust delta time to set the coarseness of the calculations. Things for you to try out: 1. Turn the gravity really low and see what happens. 2. Set the spring constant to 0. 3. Set friction to 1. 4. Set the restitution to 0. 5. See what air resistance does to the oscillations. 6. Set the spring length to a really small number and pull the two balls apart.

(view all replies)
Comment Reply