https://github.com/alz-11/ftoc
Fahrenheit to Celsius conversion analysis, comparing accurate and approximate methods with visualizations and error analysis.
https://github.com/alz-11/ftoc
approximation celsius conversion data-visualization error-analysis fahrenheit fahrenheit-to-celsius jupyter jupyter-notebook matplotlib numpy python python-3 python3
Last synced: 4 months ago
JSON representation
Fahrenheit to Celsius conversion analysis, comparing accurate and approximate methods with visualizations and error analysis.
- Host: GitHub
- URL: https://github.com/alz-11/ftoc
- Owner: ALZ-11
- Created: 2024-11-14T21:14:27.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-17T17:53:45.000Z (about 1 year ago)
- Last Synced: 2025-04-05T23:17:37.353Z (10 months ago)
- Topics: approximation, celsius, conversion, data-visualization, error-analysis, fahrenheit, fahrenheit-to-celsius, jupyter, jupyter-notebook, matplotlib, numpy, python, python-3, python3
- Language: Jupyter Notebook
- Homepage:
- Size: 445 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fahrenheit to Celsius Conversion: Accurate vs. Approximate
Welcome to the **Fahrenheit to Celsius Conversion** mini-project. In this repo, we compare two methods for converting Fahrenheit to Celsius:
1. **The Accurate Formula**: $`C = \frac{5}{9} \times (F - 32) `$
2. **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.
## Key Features
- **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 Math (Just the Essentials)
### Accurate Formula:
The accurate conversion from Fahrenheit to Celsius is:
$`
C = \frac{5}{9} \times (F - 32)
`$
### Approximate Formula:
A simplified method is:
$`
C \approx \frac{1}{2} \times (F - 32)
`$
### Absolute Error:
We calculate the absolute error between both methods:
$`
\text{Absolute Error} = \left| \frac{5}{9} (F - 32) - \frac{1}{2} (F - 32) \right|
`$
This error increases predictably at **specific Fahrenheit values**, especially every **$`36°F `$** from the focal point of **$`32°F`$**. For example, at **$`68°F`$**, **$`104°F`$**, and so on, the error increments in **$`2°C`$ steps**.
## Interactive Graphs
- 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.
## Fact
The error increments by **$`2°C`$** at **$`36°F`$ intervals** from the focal point of **$`32°F`$**. This means you can use mental math to make small adjustments to your conversion when approximating the Celsius value.
**Example**:
- At **$`68°F`$**, add **$`2°C`$**.
- At **$`104°F`$**, add **$`4°C`$**.
## Getting Started
### Prerequisites:
- **Python 3.x**
- **Jupyter Notebook** (or any compatible environment)
- **NumPy**, **Matplotlib**
Install the dependencies with:
```bash
pip install numpy matplotlib
```
### Running the Notebook:
1. Clone the repo:
```bash
git clone https://github.com/ALZ-11/FtoC.git
```
2. Navigate into the directory:
```bash
cd FtoC
```
3. Launch the notebook:
```bash
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.
## How to Contribute
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!