An open API service indexing awesome lists of open source software.

https://github.com/0pkunal/sin-value-calculator-with-python

A simple Python script that calculates the sine of a given angle in degrees.
https://github.com/0pkunal/sin-value-calculator-with-python

python python-3 python3

Last synced: 8 months ago
JSON representation

A simple Python script that calculates the sine of a given angle in degrees.

Awesome Lists containing this project

README

          

# Sin Value Calculator with Python

A simple Python script that calculates the sine of a given angle in degrees.

## Features

- Ask user to how many times they want to calculate sine values.
- Takes user input for an angle in degrees
- Converts the input to radians
- Calculates the sine value using Python’s built-in `math.sin`
- Displays the result with clear formatting
- Supports multiple calculations in a single run.
- Rounds results to **4 decimal places** for readability.

## Getting Started

### Prerequisites

- Python 3.x installed on your system

### Usage

1. Clone the repository:
```bash
git clone https://github.com/0PKunal/Sin-Value-Calculator-with-Python.git

2. Navigate to the project directory:

```bash
cd Sin-Value-Calculator-with-Python
```

3. Run the script using:

```bash
python sin_value_calculator.py
```

## Example

```bash
How many times to calculate: 3

Set 1
Enter the angel: 30
The Sin value of 30.0° is 0.5000

Set 2
Enter the angel: 45
The Sin value of 45.0° is 0.7071

Set 3
Enter the angel: 60
The Sin value of 60.0° is 0.8660
```

## Expected Input & Output

| Input (degrees) | Output (sine value) |
| --------------- | ------------------- |
| 0 | 0.0 |
| 90 | 1.0 |
| 180 | 0.0 |
| 270 | -1.0 |
| 360 | 0.0 |

*(Results may vary slightly due to floating-point precision.)*

## How It Works

The script:
1. Prompts the user to enters how many times they want to calculate sine values.
2. Prompts the user for an angle in degrees
3. Converts it to radians using `math.radians`
4. Calculates the sine using `math.sin`
5. Prints the result

## Requirements

* Python 3.x (3.13.5 Recomended)
* Standard library only (`math` module)

## Optional Enhancements

If you’d like to extend this project, consider adding:

* Support for radians input as an alternative
* A graphical user interface (GUI) using Tkinter
* Additional trigonometric functions (cos, tan, etc.)
* Command-line arguments using `argparse` for automation

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---


Made with ❤️ by 0PKunal


If this project helped you, please give it a ⭐️