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

https://github.com/deusallrising/math-base-special-atan2d

Compute the angle in the plane (in degrees) between the positive x-axis and the ray from (0,0) to the point (x,y).
https://github.com/deusallrising/math-base-special-atan2d

arctangent atan atan2 atan2d inverse javascript mathematics nodejs number quotient stdlib trig trigonometry value

Last synced: about 2 months ago
JSON representation

Compute the angle in the plane (in degrees) between the positive x-axis and the ray from (0,0) to the point (x,y).

Awesome Lists containing this project

README

        

```markdown
# 🧮 Math Base Special Atan2d

Compute the angle in the plane (in degrees) between the positive x-axis and the ray from (0,0) to the point (x,y).

![Atan2d Visualization](https://miro.medium.com/v2/resize:fit:700/1*fpyQfyFg8zySxj1gqaah6g.png)

## Table of Contents

1. [Features](#features)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Examples](#examples)
5. [Contributing](#contributing)
6. [License](#license)
7. [Contact](#contact)

## Features

- Calculate the angle in degrees for any point in 2D space.
- Works seamlessly with JavaScript and Node.js.
- Utilizes trigonometric functions to provide accurate results.
- Lightweight and easy to integrate into existing projects.
- Follows standard mathematical practices for computing angles.

## Installation

To install the package, you can use npm or yarn.

Using npm:

```bash
npm install math-base-special-atan2d
```

Using yarn:

```bash
yarn add math-base-special-atan2d
```

## Usage

After installing the package, you can import it into your project.

```javascript
const atan2d = require('math-base-special-atan2d');

// Compute angle
const angle = atan2d(y, x);
console.log(`The angle is: ${angle} degrees`);
```

This function accepts two parameters: `y` and `x`, which represent the coordinates of the point in the 2D plane.

## Examples

Here are a few examples of how to use the function:

### Example 1: Positive Coordinates

```javascript
const angle1 = atan2d(1, 1);
console.log(angle1); // Output: 45 degrees
```

### Example 2: Negative Coordinates

```javascript
const angle2 = atan2d(-1, -1);
console.log(angle2); // Output: -135 degrees
```

### Example 3: Mixed Coordinates

```javascript
const angle3 = atan2d(-1, 1);
console.log(angle3); // Output: -45 degrees
```

### Example 4: Axis-aligned Points

```javascript
const angle4 = atan2d(0, 1);
console.log(angle4); // Output: 0 degrees

const angle5 = atan2d(1, 0);
console.log(angle5); // Output: 90 degrees
```

## Contributing

We welcome contributions! If you want to improve the project, please follow these steps:

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit them (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a pull request.

## License

This project is licensed under the MIT License. Feel free to use and modify it as you see fit.

## Contact

If you have any questions or need support, feel free to reach out:

- GitHub: [Deusallrising](https://github.com/Deusallrising)
- Email: [email protected]

## Releases

For the latest version and updates, check out the [Releases section](https://github.com/Deusallrising/math-base-special-atan2d/releases). You can download and execute the files from there.

![Latest Release](https://img.shields.io/badge/latest_release-v1.0.0-brightgreen)

## Topics

This repository covers the following topics:

- **Arctangent**
- **Atan**
- **Atan2**
- **Atan2d**
- **Inverse**
- **JavaScript**
- **Math**
- **Mathematics**
- **Node.js**
- **Number**
- **Quotient**
- **Standard Library**
- **Trigonometry**
- **Value**

## Additional Resources

- [MDN Web Docs: Math.atan2()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2)
- [Wolfram Alpha: Inverse Tangent](https://www.wolframalpha.com/)
- [GeeksforGeeks: Trigonometry Basics](https://www.geeksforgeeks.org/trigonometry-basics/)

Thank you for checking out Math Base Special Atan2d! Happy coding! 😊
```