https://github.com/kennethchilds/zig-revolution
Celestial body revolution in Zig using Raylib
https://github.com/kennethchilds/zig-revolution
physics-simulation raylib-zig zig
Last synced: about 1 month ago
JSON representation
Celestial body revolution in Zig using Raylib
- Host: GitHub
- URL: https://github.com/kennethchilds/zig-revolution
- Owner: KennethChilds
- License: mit
- Created: 2025-02-05T06:07:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-31T20:24:04.000Z (about 1 year ago)
- Last Synced: 2025-03-31T21:27:42.173Z (about 1 year ago)
- Topics: physics-simulation, raylib-zig, zig
- Language: C
- Homepage:
- Size: 102 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Orbital Revolution Simulation in Zig
## Project Summary
This Zig and CPP project implements a basic orbital revolution simulation with [raylib-zig bindings](https://github.com/Not-Nik/raylib-zig) and the [raylib-cpp bindings](https://github.com/RobLoach/raylib-cpp), respectively.
## Orbital Revolution
The simulation models objects moving in circular orbits, a fundamental concept in celestial mechanics. Key aspects of the implementation include:
### Representation
An orbital revolution is represented by:
- Position (x, y coordinates)
- Angular velocity (rate of rotation)
- Radius of orbit
- Current angle
## Usage
To run the zig project, use the following command:
```sh
git clone https://github.com/KennethChilds/zig-revolution.git
cd zig-revolution
zig build run
```
To run the cpp project:
```sh
cd cpp
g++ main.cpp -o main -IC:\raylib\raylib\src -LC:\raylib\raylib\src -lraylib -lopengl32 -lgdi32 -lwinmm -lkernel32 -w; ./main
```
If your `raylib` install is not in the `C:` drive, change the command as necessary.
Play around with values and watch what happens!