Join us on Discord!
You can help CodeWalrus stay online by donating here.

Gravity Simulator [TI-84+CE]

Started by ordelore, April 13, 2017, 12:15:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ordelore

I made a gravity simulator during physics.
The directions should be self-explanatory. The arrow keys are used to adjust the object's mass and velocity.
I'll work on speed optimization later.
Requires OS 5.2.1 or greater because I use toString().
GIF included
  • Calculators owned: TI-84+SE, TI_Nspire CX
Calc Wars is still alive (I hope)

_iPhoenix_

Dang it!

I was going to do something just like this, but you did it much better than I could have.
Well done, and it is a very nice program.
  • Calculators owned: Two TI-84+ CE's
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

Alvajoy123

  • Calculators owned: TI-84+CE
The maker of Xenon.

p2

impressive.
Could u add text with the vector data and the formulas around the lines?
Then u could actually use it in a productive way during class :)

(maybe add a tiny explosion gif in the point where they meet? :D

and btw what happens if u do parallel lines?
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Snektron

Reminds me of the stuff i did during school. My calculator would often get confiscated by my physics teacher, which resulted in me talking with other students instead of minding my own calculator business. Not a smart move on her part ;D
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


p2

this was sooo much the same for me x.x
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

ordelore

Quote from: p2 on May 09, 2017, 10:48:52 PM
and btw what happens if u do parallel lines?
Because both starting positions are fixed, there is no way to have parallel lines. Also, because gravity is universal, any object travelling in parallel lines won't be doing so for long.
I initially had vector data, but the speed slowdown didn't seem worth it to me.
  • Calculators owned: TI-84+SE, TI_Nspire CX
Calc Wars is still alive (I hope)

c4ooo

#7
Quote from: p2 on May 09, 2017, 10:48:52 PM
impressive.
Could u add text with the vector data and the formulas around the lines?
Then u could actually use it in a productive way during class :)

(maybe add a tiny explosion gif in the point where they meet? :D

and btw what happens if u do parallel lines?
A=F/M
Fg = M1*M2/R^2

thus

A =  (M1*M2/R^2/)/ M

Each frame: calculate A for each object, add A to velocity of the object, then add velocity to the position. The more smaller the delta time, the more accurate the simulation is. (The reason the two object shoot off so fast in the gif is becouse the distance between them becomes very close to zero, thus making A approach infinity)

If you want to moddel an object and a fixed ("on rails") planet, which is a more often occurring scenario, A =  (M1*M2/R^2/)/ M can be simplified to  A =  Mass Of Planet/R^2

Powered by EzPortal