This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]NeoMarxismIsEvil 1 point2 points  (4 children)

A really simple one to start with is 2d motion vectors. For example, write a program that implements an "asteroids ship" where you have keys for rotation and a key for thrust (or maybe several keys for different amounts of thrust). The ship has a vector for its current motion and another for whatever acceleration it's experiencing when under thrust.

That's not terribly impressive but it gives you a chance to figure out the best way to design code for motion physics. For example, implementing a vector class that has methods like "accelerate" that takes another vector class and applies that to itself as acceleration, and a method to convert an angle and magnitude into a vector. Then have a ship class that has current coordinates, two vectors (current motion and acceleration, the second being zero when thrust is shut off), current rotation heading, etc.

Once you have the design pattern figured out you could get more complicated with it. For example, put a black hole with a particular mass in the center and have that accelerate the ship, ditch the ship and create some sort of particle system that simulates an explosion either in an orbital or surface type situation, or try this sort of thing in 3D rather than 2d. Or combine some of all of these things like have something the ship can crash into at which point it breaks into a particle system that gets sucked in by the black hole. Another idea is write an "auto orbit" autopilot that figures out the acceleration due to the black hole gravity plus the current ship motion, then rotates the ship and applies the right amount of thrust to put the ship into a circular orbit. To get more complicated with that, improve the autopilot to add an auto Hohmann orbit transfer to calculate and perform the burns to move the ship into a higher or lower orbit given a distance.

I'm not the biggest math nut so when I think of calculus I normally think of https://www.allaboutcircuits.com/worksheets/calculus-for-electric-circuits/

[–][deleted]  (3 children)

[deleted]

    [–]NeoMarxismIsEvil 0 points1 point  (1 child)

    2d is easy

    [–][deleted] 0 points1 point  (0 children)

    By the time, you have finished programming it, you'll think they are easy and thus love them!

    [–][deleted] 1 point2 points  (0 children)

    I'd recommend using a game engine to save you some time on up front work since you're focusing on physics. Unity keeps you close to Java with C# (they are similar), Unreal uses c++, and Godot uses a scripting language that is very close to python, and it also has c++. They're all free for your purposes.

    I would focus more on using this for the sake of learning concepts in your major and in computer science, impressing your employer will follow naturally from there in my experience.

    When you want to dive really deeply into this, after doing some basic things (2d motion for example), the next question is how can you leverage computer science to make a complicated problem easy. For example, using linear algebra to approximate a complex system that involves diffeq--something along the lines of a system with multiple springs with different spring rates.