Skip to content

About

Physics web application that solves Newton’s laws, momentum, projectile motion, work and energy problems with formulas and step-by-step calculations.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Dinglo Physics Solver

Tests Python 3.10+ MIT License Contributions welcome

A polished Python web application that solves introductory mechanics problems from the variables supplied by the learner. It covers Newton's laws, momentum, projectile motion, work and energy while showing the formula, substitution and final answer.

Contributions are welcome. Choose an open issue, fork the repository and submit a pull request. New contributors can start with tasks labelled good first issue.

About the project

Dinglo Physics Solver is designed for learners who know some of the variables in a mechanics problem but need to determine the missing quantity.

For most calculators:

  1. Enter the known values.
  2. Leave exactly one unknown variable blank.
  3. Select Solve question.
  4. Read the rearranged formula, substitution and final answer.

Projectile calculators return the main motion quantities together.

Calculators included

Topic Calculator Main equation
Forces Newton's second law F = ma
Forces Newton's third law F₂ = -F₁
Momentum Linear momentum p = mv
Momentum Impulse J = FΔt
Momentum Conservation of momentum m₁u₁ + m₂u₂ = m₁v₁ + m₂v₂
Projectile motion Angled projectile T = 2u sinθ/g, R = u² sin2θ/g
Projectile motion Horizontal launch t = √(2h/g), R = ut
Energy Work done W = Fd cosθ
Energy Kinetic energy Eₖ = ½mv²
Energy Gravitational potential energy Eₚ = mgh

Features

  • Python calculation engine
  • Automatic unknown-variable detection
  • Formula rearrangement and step-by-step working
  • Input validation with learner-friendly error messages
  • Support for negative velocities to represent direction
  • Default gravitational acceleration of 9.81 m/s² when the field is blank, with zero and negative gravity rejected
  • Light and dark modes with automatic system-theme detection
  • Saved theme preference across browser sessions
  • Responsive Dinglo interface for phones, tablets and computers
  • No database, API key or third-party Python package required
  • JSON endpoint for every calculation

Technology

  • Python 3.10+
  • Python standard-library HTTP server
  • HTML5 templates
  • CSS3
  • Vanilla JavaScript

The physics calculations are performed by Python. JavaScript sends the supplied variables to the Python endpoint and displays the returned solution.

Project structure

Dinglo-Physics-Solver/
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.yml
│   │   ├── config.yml
│   │   └── feature_request.yml
│   ├── workflows/
│   │   └── tests.yml
│   └── PULL_REQUEST_TEMPLATE.md
├── docs/
│   ├── CONTRIBUTOR_TASKS.md
│   ├── MAINTAINER_SETUP.md
│   └── PHYSICS_CONTRIBUTION_GUIDE.md
├── static/
│   ├── app.js
│   └── style.css
├── templates/
│   └── index.html
├── tests/
│   └── test_solvers.py
├── .gitattributes
├── .gitignore
├── app.py
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── pyproject.toml
├── README.md
├── requirements.txt
└── SECURITY.md

Run locally

Requirements

  • Python 3.10 or newer
  • A modern web browser

Steps

Clone the repository:

git clone https://github.com/YOUR-USERNAME/Dinglo-Physics-Solver.git
cd Dinglo-Physics-Solver

Start the server:

python app.py

Open the address shown in the terminal. By default:

http://127.0.0.1:5000

No pip install step is required because the project uses only Python's standard library.

Using a different port

The server reads the standard PORT environment variable.

Linux or macOS:

PORT=8000 python app.py

Windows PowerShell:

$env:PORT=8000
python app.py

Run the tests

python -m unittest discover -s tests -v

The automated test suite checks the main equations, inverse calculations, projectile outputs and validation errors.

Contributing

Contributions are welcome from beginners and experienced developers.

  1. Read CONTRIBUTING.md.
  2. Choose an issue labelled good first issue or help wanted.
  3. Fork the repository and create a focused branch.
  4. Make the change and add tests.
  5. Run the complete test suite.
  6. Open a pull request using the included template.

See Contributor Task Ideas for ready-to-create community issues. Physics changes must follow the Physics Contribution Guide.

Repository owners should complete the one-time Maintainer Setup after uploading the files to GitHub.

API

The browser communicates with:

POST /api/solve

Example request:

{
  "calculator": "newton2",
  "values": {
    "F": "",
    "m": "10",
    "a": "2.5"
  }
}

Example response:

{
  "answer": "F = 25 N",
  "steps": [
    "Formula: F = ma",
    "Substitute: F = (10.0)(2.5)",
    "Answer: F = 25 N"
  ]
}

Available calculator identifiers:

newton2
newton3
momentum
impulse
collision
projectile
horizontal
work
kinetic
potential

Deployment

Deploy the repository on a server that can run Python continuously. Start the application with:

python app.py

The hosting service may provide its own PORT value, which the application detects automatically.

Accuracy note

This tool supports learning and checking calculations. Learners should still:

  • convert values to SI units;
  • use signs consistently for direction;
  • round only at the final step; and
  • follow the conventions required by their lecturer or examination.

Author

Mangena Kegorapetse
Founder and Full-Stack Developer
Dinglo

License

Released under the MIT License. Copyright © 2026 Mangena Kegorapetse.

About

Physics web application that solves Newton’s laws, momentum, projectile motion, work and energy problems with formulas and step-by-step calculations.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages