Two masses and a spring v3

Your browser needs java to view projects. Click here to install Java.

user_icon Canthiar shared it 2 years, 6 months ago
2658 views, 2 taggers, 47 people love it, 1 remix by 1 person, 284 downloads, in 11 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
piter239 piter239 1 month ago

I just LOVE such thigs - minimum of objects and scripts, maximum fun and insight! Thanks

ynr24 ynr24 10 months, 4 weeks ago

That's great physics! I'm a little too young to understand how you did it, but very interesting!

keller keller 1 year, 3 months ago

that's pretty cool. how'd you get the rubberband effect goin there?

Canthiar Canthiar 1 year, 3 months ago

I used the spring equation F = -k * x where k is the spring constant and x is the difference between the length of the spring at rest and the current length of the spring.

homonid homonid 1 year, 4 months ago

something is a miss. your gravity is wrong.

blackhawk blackhawk 1 year, 5 months ago

cul

alan_x alan_x 1 year, 5 months ago

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

mpa1212 mpa1212 1 year, 5 months ago

cool

inuwali inuwali 1 year, 6 months ago

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

iceprincess9021 iceprincess9021 1 year, 7 months ago

hmmmm

GodzGirl GodzGirl 1 year, 9 months 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

Zachman Zachman 1 year, 10 months ago

boring

Canthiar Canthiar 1 year, 11 months ago

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

Lucario621 Lucario621 1 year, 11 months 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!

Canthiar Canthiar 2 years, 1 month 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.

Lucario621 Lucario621 2 years, 1 month ago

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

Kaleh Kaleh 2 years, 1 month ago

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

Canthiar Canthiar 2 years, 1 month 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.

Canthiar Canthiar 2 years, 1 month 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.

BATzerk BATzerk 2 years, 1 month 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

BATzerk BATzerk 2 years, 1 month 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...)

BATzerk BATzerk 2 years, 1 month 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...

Canthiar Canthiar 2 years, 2 months ago

I don't mind.

Bloing_Gloing Bloing_Gloing 2 years, 2 months ago

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

bigreader bigreader 2 years, 2 months ago

Wow.

bigreader bigreader 2 years, 2 months ago

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

kan kan 2 years, 3 months ago

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

kan kan 2 years, 3 months ago

Cool.

seville seville 2 years, 3 months ago

Incredible workings with science. Hands together for you again!

MESclan MESclan 2 years, 3 months ago

THIS IS AWESOME!!!!!!

Canthiar Canthiar 2 years, 4 months ago

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

Babygirl Babygirl 2 years, 4 months ago

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

lozzamon626 lozzamon626 2 years, 5 months ago

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

lozzamon626 lozzamon626 2 years, 5 months ago

its cool

Canthiar Canthiar 2 years, 5 months ago

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

DaniePeep DaniePeep 2 years, 5 months ago

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

MyRedNeptune MyRedNeptune 2 years, 5 months ago

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

maggie maggie 2 years, 6 months ago

coooooooooooooooooool.

Bingo_324 Bingo_324 2 years, 6 months ago

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

Mick Mick 2 years, 6 months ago

That is SO cool!!!!

Canthiar Canthiar 2 years, 6 months 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.

Canthiar Canthiar 2 years, 6 months 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.

zippzom zippzom 2 years, 6 months ago

the programming is all greek to me

archmage archmage 2 years, 6 months ago

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

blood_elf blood_elf 2 years, 6 months ago

this is the best fing like that I have ever seen

purplefromossett purplefromossett 2 years, 6 months 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?

Crusader6 Crusader6 2 years, 6 months ago

wow

blood_elf blood_elf 2 years, 6 months ago

this is so cool im adding it to my favorites

cairparavel cairparavel 2 years, 6 months ago

This is great. Load to experiment with and discover.

Zeberman Zeberman 2 years, 6 months ago

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

mohlar mohlar 2 years, 6 months ago

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

fandebiao fandebiao 2 years, 6 months ago

good job

supersteph supersteph 2 years, 6 months ago

good jod i love it

orenz orenz 2 years, 6 months ago

this is great, well done!

andresmh andresmh* 2 years, 6 months ago

Impressive.

1000Master 1000Master 2 years, 6 months ago

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

Canthiar Canthiar 2 years, 6 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.

Canthiar Canthiar 2 years, 6 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.

barnes barnes 2 years, 6 months ago

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

Canthiar Canthiar 2 years, 6 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.

Canthiar Canthiar 2 years, 6 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.

Please Wait...