Skip to content

Rexaintreal/Ziks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ziks Logo

Ziks

A web app with interactive physics simulations built to visualize various physics concepts

GitHub Axiom Hackatime Flask JavaScript HTML5 Canvas


About

Ziks is a web app i built with 21 physics simulations which covers many fields of physics from mechanics to optics and even modern physics i picked the topics from my university entrance exam (JEE) books (yup thats literally my physics syllabus :sob) i created everything from scratch using Canvas 2D in JavaScript and vanilla CSS for the design because I find it more controllable (eh? i hope you understand that lol) Ziks is hosted on PythonAnywhere at LINK try it and share your feedback! I made this project for Axiom YSWS a Hack Club YSWS


Demo Video

The Demo video where I go through all 21 simulations running locally and some other features too

DEMO


Try it (ITS LIVE)

Ziks is hosted on pythonanywhere and you can visit it at LINK

Features

Here are all the 21 simulations organized by physics domain:

Mechanics (9 Simulations)

  • Projectile Motion: Change the angles speed and gravity to see your object launch like angry birds (literally)
  • Force Engine: Push pull add more forces add more blocks and experiment with forces
  • Pendulum: Adjust length and gravity drag it to 360 degrees to watch oscillations
  • Inclined Plane: Watch blocks slide down adjustable inclines with friction and mass
  • Circular Motion: Spin objects and observe centripetal force, velocity, and angular motion
  • Spring System: Simulate oscillations with mass, spring constant, and damping controls
  • Collision Simulation: Elastic and inelastic collisions visualize momentum and energy conservation
  • Torque & Equilibrium: Balance beams with weights at different distances and watch rotational physics
  • Rolling Motion: Simulate shapes rolling down ramps and see how moment of inertia affects speed

Waves & Sound (3 Simulations)

  • Wave Interference: Create interference patterns with multiple wave sources and visualize superposition
  • Standing Waves: Visualize harmonics, nodes, and antinodes on vibrating strings with adjustable tension
  • Doppler Effect: Hear frequency shifts as sound sources move you can drag the source to create custom paths too

Electromagnetism (3 Simulations)

  • Electric Field: Place charges and visualize electric fields with field lines, vectors, and equipotentials
  • RC Circuits: Simulate capacitors charge and discharge through resistors and see exponential curves in real-time
  • Magnetic Induction: Visualize Faraday's Laws with interactive magnets and graphs

Optics (3 Simulations)

  • Snell's Law: Visualize refraction and reflection with real-time light bending and total internal reflection
  • Lenses & Image Formation: Explore convex and concave lenses with ray diagrams showing real and virtual image formation
  • Diffraction & Interference: Visualize double slit experiment with intensity patterns control wavelength and slit spacing

Thermodynamics (2 Simulations)

  • Thermal Expansion: Heat up solids and liquids to visualize dimension changes with different materials and coefficients
  • Gas Laws: See Gas particles bounce around adjust PVNRT variables and switch between ideal and real gas models

Modern Physics (1 Simulation)

  • Photoelectric Effect: Shine light on metal surfaces visualize electron emission and measure stopping potential with quantization

Project Structure

Ziks/
├── devlogs/             # Screenshots of all simulations and the landing page 
├── static/               
│   ├── assets/          # Logo files and favicon
│   ├── css/             # Individual CSS for each simulation + global styles
│   └── js/              # Canvas based simulation scripts and universal script.js for theme toggle
├── templates/           # HTML templates for all pages
├── .gitignore           # Git ignore file
├── app.py               # Main Flask application with all routes
├── LICENSE              # MIT License
├── README.md            # You are reading this lol
└── requirements.txt     # Python dependencies (only Flask)

Setup and Installation

Prerequisites

  • Python 3.13+ (I used 3.13.5 but anything 3.13+ should work fine)
  • pip for installing packages
  • Any modern browser (Chrome, Firefox, Edge the simulations use Canvas API)

Performance Note: I tested all the simulations on an i5-12450HX with RTX 4050 (6GB) and 16GB DDR5 RAM If you experience lag on lower-end hardware you can adjust the FPS by modifying the dt value in the individual simulation's JavaScript file The default is 0.016 (60 FPS) you can increase it to 0.033 (30 FPS) or higher to reduce CPU usage.

Installation Steps

  1. Clone the repo:

    git clone https://github.com/Rexaintreal/Ziks.git
    cd Ziks
  2. Create a virtual environment (recommended):

    This keeps things clean and doesn't mess with your other Python projects (i dont usually do it T_T)

    Windows:

    python -m venv venv
    .\venv\Scripts\activate

    macOS / Linux:

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

    It's just Flask

  4. Run the app:

    python app.py
  5. Open it up:

    Go to http://127.0.0.1:5000 in your browser


Usage

pretty straightforward:

  1. Landing page shows all 21 simulations organized by category
  2. Click on any simulation you want to try
  3. Use the control panel on the right to adjust parameters (sliders, dropdowns, checkboxes)
  4. Hit Start/Play to run the simulation
  5. Most simulations have:
    • Real-time graphs showing values over time
    • Zoom and pan controls (scroll to zoom, drag to pan using mouse and keyboard both)
    • Play/Pause and Reset buttons
    • Dark/Light mode toggle (saved in localStorage)
    • Equations and formulas displayed on canvas

Technical Details

Each simulation is built using:

  • HTML5 Canvas for all the rendering and animations
  • Vanilla JavaScript for physics calculations and animation loops using requestAnimationFrame
  • CSS3 for styling with custom dark/light themes
  • Flask as the backend (basically just routing no heavy backend logic like auth or databases)

The simulations run entirely client-side after the page loads, so they're pretty smooth. I tried to keep the physics equations as accurate as possible while still making them visually interesting.


Browser Compatibility

Ziks works best on desktop browsers Not optimized for mobile yet (the control panels take up too much space on small screens and the navbar too)


License

MIT LICENSE.


Acknowledgements

THE INTERNET - physics tutorials and Canvas API docs


You may also like...

Some other projects I've built:


Author

Built by Saurabh Tiwari