- #1
sa1988
- 222
- 23
- TL;DR Summary
- I've started work on a physics library in C#. I work professionally as a programmer and have a physics degree, however the idea of turning physics into code never really occurred to me. So far it's been fun. Project is open source. Join!
TL:DR;
I've started an open source C# physics library: University Physics
The Long Version
So it turns out there's relatively little in the way of full physics libraries written in C# (the best I can find is bepuphysics which seems to be focused only on classical mechanics). With this discovery as motivation, I've decided to start work on a C# library for performing as much general physics calculation as possible, in all sub-topics of physics.
So that's mechanics, electromagnetism, thermodynamics, quantum mechanics, fluid dynamics... anything involving turning the real world into equations and numbers. The library will be useful in basic games, simulations and as a basic learning tool for people interested in physics and programming via C#.
The aim is to simplify the work that is required to turn a set of physical values or items into a useful result. A personal example is in a physics simulator I created several years ago, in which a load of particles floated around the screen and repelled each other on close proximity with other particles.
For that simulator, I needed to write the code for electrostatic force myself from scratch. Via this new physics library, it would be as simple as:
So basically the user just creates what they want, sets it up and presses 'Go'.
At first I'm going to go through the classic University Physics textbook (Young & Freedman), turning as much of the content as possible into usable objects and classes. After that I'll move onto more advanced subjects, or just whatever takes my fancy as I go.
The primary aim at the moment is to just create a library of 'physics stuff'. Performance and optimisation will come later.
I'm setting up this thread for two purposes:
I've never worked on an open source project before, so this aspect is being entered with a mixture of interest and mild trepidation.
If you're interested in contributing to the project, reply to this thread or follow/fork the project on GitHub.
Project Repository is here: University Physics
Thanks
I've started an open source C# physics library: University Physics
The Long Version
So it turns out there's relatively little in the way of full physics libraries written in C# (the best I can find is bepuphysics which seems to be focused only on classical mechanics). With this discovery as motivation, I've decided to start work on a C# library for performing as much general physics calculation as possible, in all sub-topics of physics.
So that's mechanics, electromagnetism, thermodynamics, quantum mechanics, fluid dynamics... anything involving turning the real world into equations and numbers. The library will be useful in basic games, simulations and as a basic learning tool for people interested in physics and programming via C#.
The aim is to simplify the work that is required to turn a set of physical values or items into a useful result. A personal example is in a physics simulator I created several years ago, in which a load of particles floated around the screen and repelled each other on close proximity with other particles.
For that simulator, I needed to write the code for electrostatic force myself from scratch. Via this new physics library, it would be as simple as:
C#:
ParticleSet particles = new ParticleSet
{
Particles = new List<Particle>()
{
new Particle(mass: 1, position: new Vector(0,1,0), charge: 1),
new Particle(mass: 1, position: new Vector(0,2,0), charge: 1),
new Particle(mass: 1, position: new Vector(3,2,0), charge: 4),
new Particle(mass: 1, position: new Vector(1,0,0), charge: 1),
}
}
particleSet.Move(timeDelta: t);
So basically the user just creates what they want, sets it up and presses 'Go'.
At first I'm going to go through the classic University Physics textbook (Young & Freedman), turning as much of the content as possible into usable objects and classes. After that I'll move onto more advanced subjects, or just whatever takes my fancy as I go.
The primary aim at the moment is to just create a library of 'physics stuff'. Performance and optimisation will come later.
I'm setting up this thread for two purposes:
- To provide updates on progress
- To inform others about the project so they can join in if they wish
I've never worked on an open source project before, so this aspect is being entered with a mixture of interest and mild trepidation.
If you're interested in contributing to the project, reply to this thread or follow/fork the project on GitHub.
Project Repository is here: University Physics
Thanks