Skip to content

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

License

Notifications You must be signed in to change notification settings

Deusallrising/math-base-special-atan2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# 🧮 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:

yarn add math-base-special-atan2d

Usage

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

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

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

Example 2: Negative Coordinates

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

Example 3: Mixed Coordinates

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

Example 4: Axis-aligned Points

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:

Releases

For the latest version and updates, check out the Releases section. You can download and execute the files from there.

Latest Release

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

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

About

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

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •