npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

matherrias

v1.3.0

Published

![license](https://img.shields.io/badge/license-MIT-blue) ![version](https://img.shields.io/badge/version-1.3.0-blue) <div align="center"> <a href="https://opencollective.com/matherrias" target="_blank" rel="noopener noreferrer"> <img width="300"

Downloads

10

Readme

license version

Type

Circle Cone Cube Parallelepiped Rectangle Regularpolygon Rhombus Sphere Square Trapezoid Triangle

Circle

Area

circleGetArea

  • usage
/*
    @param r - Radius of the circle
    @param P - Pi (mathematical constant, approximately 3.14)
*/
const circleGetArea = require('matherrias');

// Set the radius value (replace '5' with your desired radius)
const r = 5;

// Set the value of Pi (approximately 3.14)
const Pi = 3.14;

// Calculate the area using the circleGetArea function
const result = circleGetArea(r, Pi);

// Output the result
console.log(result);

Cone

Area

coneGetArea

  • usage
/*
    @param r - Radius of the cone's base
    @param s - Slant height of the cone
*/
const coneGetArea = require('matherrias');

// Set the radius of the cone's base (replace '4' with your desired radius)
const radius = 4;

// Set the slant height of the cone (replace '7' with your desired slant height)
const slantHeight = 7;

// Calculate the surface area of the cone using the coneGetArea function
const result = coneGetArea(radius, slantHeight);

// Output the result
console.log(result);

Cube

Volume

cubeGetVolume

  • usage
/*
    @param s - Side length of the cube
*/
const cubeGetVolume = require('matherrias');

// Set the side length value (replace '3' with your desired side length)
const s = 3;

// Calculate the volume using the cubeGetVolume function
const volume = cubeGetVolume(s);

// Output the result
console.log(volume);

Parallelepiped

Volume

parallelepipedGetVolume

  • usage
/*
    @param l - Length of the parallelepiped
    @param w - Width of the parallelepiped
    @param h - Height of the parallelepiped
*/
const parallelepipedGetVolume = require('matherrias');

// Set the dimensions of the parallelepiped
const length = 3;  // Replace with your desired length
const width = 4;   // Replace with your desired width
const height = 5;  // Replace with your desired height

// Calculate the volume using the parallelepipedGetVolume function
const volume = parallelepipedGetVolume(length, width, height);

// Output the result
console.log(volume);

Rectangle

Area

rectangleGetArea

  • usage
/*
    @param w - Width of the rectangle
    @param h - Height of the rectangle
*/
const rectangleGetArea = require('matherrias');

// Set the width and height values (replace '4' and '6' with your desired values)
const width = 4;
const height = 6;

// Calculate the area using the rectangleGetArea function
const area = rectangleGetArea(width, height);

// Output the result
console.log(area);

Regularpolygon

Area

regularpolygonGetArea

  • usage
/*
    @param P - Perimeter of the regular polygon
    @param a - Length of each side of the regular polygon
*/
const regularPolygonGetArea = require('matherrias');

// Set the perimeter value (replace '20' with your desired perimeter)
const P = 20;

// Set the length of each side (replace '4' with your desired side length)
const a = 4;

// Calculate the area using the regularPolygonGetArea function
const result = regularPolygonGetArea(P, a);

// Output the result
console.log(result);

Rhombus

Area

rhombusGetArea

  • usage
/*
    @param D - Length of the longer diagonal
    @param d - Length of the shorter diagonal
*/
const rhombusGetArea = require('matherrias');

// Set the length of the longer diagonal (replace '8' with your desired value)
const D = 8;

// Set the length of the shorter diagonal (replace '6' with your desired value)
const d = 6;

// Calculate the area using the rhombusGetArea function
const result = rhombusGetArea(D, d);

// Output the result
console.log(result);

Sphere

Area

sphereGetArea

  • usage
/*
    @param r - Radius of the sphere
*/
const sphereGetArea = require('matherrias');

// Set the radius value (replace '3' with your desired radius)
const r = 3;

// Calculate the surface area using the sphereGetArea function
const result = sphereGetArea(r);

// Output the result
console.log(result);

Square

Area

squareGetArea

  • usage
/*
    @param l - Length of one side of the square
*/
const squareGetArea = require('matherrias');

// Set the length of one side of the square (replace '4' with your desired length)
const l = 4;

// Calculate the area using the squareGetArea function
const result = squareGetArea(l);

// Output the result
console.log(result);

Trapezoid

Area

trapezoidGetArea

  • usage
/*
    @param B - Length of the longer base of the trapezoid
    @param b - Length of the shorter base of the trapezoid
    @param h - Height of the trapezoid
*/
const trapezoidGetArea = require('matherrias');

// Set the lengths of the bases and the height (replace values as needed)
const B = 8;  // Length of the longer base
const b = 5;  // Length of the shorter base
const h = 3;  // Height of the trapezoid

// Calculate the area using the trapezoidGetArea function
const result = trapezoidGetArea(B, b, h);

// Output the result
console.log(result);

Triangle

Area

triangleGetArea

  • usage
/*
    @param b - Base length of the triangle
    @param h - Height of the triangle
*/
const triangleGetArea = require('matherrias');

// Set the base length (replace '6' with your desired base length)
const baseLength = 6;

// Set the height (replace '8' with your desired height)
const height = 8;

// Calculate the area using the triangleGetArea function
const triangleArea = triangleGetArea(baseLength, height);

// Output the result
console.log(triangleArea);