Welcome to the Fahrenheit to Celsius Conversion mini-project. In this repo, we compare two methods for converting Fahrenheit to Celsius:
-
The Accurate Formula:
$C = \frac{5}{9} \times (F - 32) $ -
The Approximate Formula:
$C \approx \frac{1}{2} \times (F - 32) $
We dive into how the approximation performs compared to the accurate conversion, and how the error behaves at specific Fahrenheit values.
- Accurate vs. Approximate Conversion: Understand the difference and where the approximation works best.
- Error Analysis: Visualize the error pattern between both methods.
- Insight: Discover the unexpected regularity in the error increments.
The accurate conversion from Fahrenheit to Celsius is:
A simplified method is:
We calculate the absolute error between both methods:
This error increases predictably at specific Fahrenheit values, especially every
- Graphs comparing the results of both conversion methods.
- Error graphs highlighting key points where the error increases by
$2°C$ every$36°F$ from 32°F.
These plots give us a visual insight into the regularity of the error and how far apart the two methods diverge.
The error increments by
Example:
- At
$68°F$ , add$2°C$ . - At
$104°F$ , add$4°C$ .
- Python 3.x
- Jupyter Notebook (or any compatible environment)
- NumPy, Matplotlib
Install the dependencies with:
pip install numpy matplotlib
- Clone the repo:
git clone https://github.com/ALZ-11/FtoC.git
- Navigate into the directory:
cd FtoC
- Launch the notebook:
jupyter notebook mainFtoC.ipynb
Once the notebook is open, you'll find a step-by-step walkthrough that includes analysis and visualisations. The visual elements will make it easy to see the mathematical relationships at play.
If you have suggestions or want to improve this project, here's how you can help:
- Fork the repository and submit a pull request! I welcome fixes, enhancements, or new features.
- Share your own improvements to the visualizations or error analysis for an even better understanding of the conversion process.
Tip: For a more interactive experience, consider adding your own graphs, analysis, or improving the layout.
Feel free to dive into the notebook and explore all the interesting patterns of Fahrenheit to Celsius conversion!