Skip to content
← Back to Community
Gravity Simulator
Profile icon
hacker
has Hacker Plan
MrEconomical

this is a gravity simulator

I thought it would be cool to be able to mess around with gravity and experiment, so I made this simple gravity simulator.

Features

  • Scientifically accurate (for the most part)
  • Interactive object placement and deletion
  • Customizable gravity values and object masses
  • Tick warping
  • Hotkeys (G for gravity spot, O for object, and X for delete)

A few notes:

The objects do not collide with each other and instead pass through each other, and the gravity spots are fixed (not influenced by gravity)

Simulation might be a bit buggy on very small screens because of how the scaling works but for the most part it's fine

If you zoom out a ton it's laggy

Voters
Profile icon
RyanLiang5
Profile icon
FrancisPan
Profile icon
h00p
Profile icon
firedragondnd
Profile icon
ZetaCommand
Profile icon
DMycroft
Profile icon
AncientBison
Profile icon
furniture
Profile icon
DarkswordsmanJG
Profile icon
HyawMatias
Comments
hotnewtop
Profile icon
Zavexeon

Why is everyone better at programming than me lol.

Profile icon
emotionbot

@Zavexeon
welcome to the jungle!

Profile icon
arashwales123

@Zavexeon
If it makes it any better im not better than you

Profile icon
arashwales123

@Zavexeon
but my profile pic is an alpaca

Profile icon
HenryZelonka1

@arashwales123
I'm not better, either.

Profile icon
techgeek680

welcome to the club.

@Zavexeon

Profile icon
DarkswordsmanJG

I am not that good at coding myself

Profile icon
staticvoidliam7

lol
image

Profile icon
DJWang

Screen Shot 2020-02-09 at 9.38.26 PM

I made a black hole

Profile icon
shreykeny

@DJWang
LOL 😆

Profile icon
PowerCoder

If you hold an object to two grey spots you'll get a perfect orbit. (Really nice and satisfying by the way. Great job!)

Profile icon
DJWang

how do control the number of mass

Profile icon
MrEconomical

@DJWang
open up the settings on the bottom of the toolbar

Profile icon
Dart

36DD8D9C-F15D-4619-80B5-4EF11A671C78
Is this dead yet?

Profile icon
ch1ck3n

image
WHAT WILL HAPPEN

Profile icon
matthewproskils

image

Profile icon
[deleted]

Why don’t you take this to the next level and make a quantum simulator?

Profile icon
PizzaRules668

You should try to make a 3D version

Profile icon
JORDANSISNEY

When I set the gravity to max, I created an orbit where the blue ball goes around in an oval pattern, but then it moves just enough that it creates a spirograph!! Imagine that? Having a year within a year :D

Profile icon
PantheraLeo04

@JORDANSISNEY
Most planets' orbits actually do rotate like how you described.

Profile icon
JORDANSISNEY

@PantheraLeo04
o

welp XD

Profile icon
AtticusKuhn

It is like universe sandbox.

Profile icon
[deleted]

Nice. You should also look into matter.js

Profile icon
FrancisPan

image

To infinity... AND BEYOND!!!

(it goes on forever)

Profile icon
PyVedant

Very nice!

Profile icon
KobeFF

@MrEconomical
Can I feature this sim on a math&physics website that I am building with other people? Our website is https://www.physimx.tech

Profile icon
MrEconomical

@KobeFF
of course! that would be great :)

Profile icon
KobeFF
Profile icon
AshCodz

cool

Profile icon
thenullified

its the most beautiful thing i have ever seen. been looking at this for hours now

Profile icon
techgeek680

wow!

Profile icon
awesome10

so satisfying bro

Profile icon
isaacproskils

This file cannot be displayed:

Profile icon
isaacproskils

image

Profile icon
Andi_Chin

my planet is just gaining infinite energy

Profile icon
UncleSamIs234

This looks super cool it doesn't look like you used HTML it's just so cool.

Profile icon
moranstephen

very well done

Profile icon
WaffleCode

Mine won't load. =[ Probably my AWFUL school connection

Profile icon
RakelHasfjord

cooli

Profile icon
sycrepl

yo i just made a binary figure 8 :O

Profile icon
MatthewDoan1

Nice. Can you add an option to adjust the length of the trail? I want to see the lengths of my comets!

Profile icon
MrEconomical

@MatthewDoan1
how much longer you want

Profile icon
MatthewDoan1

@MrEconomical

an option

Profile icon
AroojKhan

super cool!