https://github.com/nhsz/parallelogram-area
Get the area of a parallelogram, given the base and height
https://github.com/nhsz/parallelogram-area
area geometry math nodejs npm npm-package parallelogram parallelogram-area polygons
Last synced: 7 months ago
JSON representation
Get the area of a parallelogram, given the base and height
- Host: GitHub
- URL: https://github.com/nhsz/parallelogram-area
- Owner: nhsz
- License: mit
- Created: 2017-06-02T17:06:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T17:38:39.000Z (over 8 years ago)
- Last Synced: 2025-03-12T00:48:39.714Z (7 months ago)
- Topics: area, geometry, math, nodejs, npm, npm-package, parallelogram, parallelogram-area, polygons
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/parallelogram-area
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parallelogram-area
[](https://nodei.co/npm/parallelogram-area/)
> Get the **[`area of a parallelogram`](https://en.wikipedia.org/wiki/Parallelogram#Area_formula)**, given the base and height
## Install
```
$ npm install --save parallelogram-area
```## Usage
```js
const parallelogramArea = require('parallelogram-area')console.log(parallelogramArea(2.5, 4.37))
// => 10.925console.log(parallelogramArea(1, 1))
// => 1console.log(parallelogramArea(3, Math.PI))
// => 9.42477796076938console.log(parallelogramArea(0, 78))
// => Error: Invalid input. Sides of the parallelogram must be greater than 0console.log(parallelogramArea(1, -1))
// => Error: Invalid input. Sides of the parallelogram must be greater than 0
```## License
MIT © **[`Nicolás Quiroz`](https://nicolasquiroz.com)**