Code Monkey home page Code Monkey logo

roll-calc's Introduction

roll-calc

Roll calculator functions.

This module was created for calculating dimesions of materials in rolls for inventory and winding machines.

Install

npm install roll-calc

Usage

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

API

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

roll-calc's People

Contributors

coryasilva avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.