Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Roll calculator functions.
This module was created for calculating dimesions of materials in rolls for inventory and winding machines.
npm install roll-calc
import { rollSolve } from 'roll-calc';
const materialHeight = 0.06;
const innerDiameter = 18;
const outerDiameter = 60;
const length = rollSolve(materialHeight, innerDiameter, outerDiameter);
console.log(length);
//=> 42882.74547004675
function rollLength(h: number, d0: number, d1: number): number | undefined
Calculates length of a roll (2D spiral).
Equations from https://www.giangrandi.ch/soft/spiral/spiral.shtml
import { rollLength } from 'roll-calc';
const materialHeight = 0.1;
const innerDiameter = 2;
const outerDiameter = 3;
const length = rollLength(materialHeight, innerDiameter, outerDiameter);
console.log(length);
//=> 39.27313461871492
function rollOuterDiameter(h: number, d0: number, l: number, maxIter?: number): number | undefined
Calcuates the outer diameter of a roll (2D spiral).
import { rollOuterDiameter } from 'roll-calc';
const materialHeight = 0.1;
const innerDiameter = 2;
const length = 39.273_134_62;
const outerDiameter = rollOuterDiameter(materialHeight, innerDiameter, length);
console.log(outerDiameter);
//=> 3.0000000000272684
function rollInnerDiameter(h: number, d1: number, l: number): number | undefined
Calculates the inner diameter of a roll (2D spiral).
import { rollInnerDiameter } from 'roll-calc';
const materialHeight = 0.1;
const outerDiameter = 3;
const length = 39.273_134_62;
const innerDiameter = rollInnerDiameter(materialHeight, innerDiameter, length);
console.log(innerDiameter);
//=> 1.999999999959101
rollMaterialHeight(d0: number, d1: number, l: number): number | undefined
Calculates the nominal material height or thickness in a roll (2D Spiral).
Equations from:
Thickness of Material on a Roll Winding: Machines, Mechanics and Measurements By James K. Good, David R. Roisum page 124
import { rollMaterialHeight } from 'roll-calc';
const innerDiameter = 2;
const outerDiameter = 3;
const length = 39.273_134_62;
const materialHeight = rollMaterialHeight(innerDiameter, outerDiameter, length);
console.log(materialHeight);
//=> 0.09999178458720241
function rollSolve(h?: number, d0?: number, d1?: number, l?: number): number | undefined
Solves one missing dimension of a roll (2D spiral).
Pass in at least three arguments to solve for the fourth.
import { rollSolve } from 'roll-calc';
const materialHeight = 0.06;
const innerDiameter = 18;
const outerDiameter = 60;
const length = rollSolve(materialHeight, innerDiameter, outerDiameter, undefined);
console.log(length);
//=> 42882.74547004675
FAQs
Roll (spiral) calculator functions.
We found that roll-calc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.