Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
coryasilva committed Dec 31, 2023
1 parent caadd84 commit 7dba28b
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ console.log(length);

## API

### `function rollLength(h: number, d0: number, d1: number): number`
### `function rollLength(h: number, d0: number, d1: number): number | undefined`

Calculates length of a roll (2D spiral).

Expand All @@ -44,7 +44,7 @@ console.log(length);
//=> 39.27313461871492
```

### `function rollOuterDiameter(h: number, d0: number, l: number, maxIter?: number): number`
### `function rollOuterDiameter(h: number, d0: number, l: number, maxIter?: number): number | undefined`

Calcuates the outer diameter of a roll (2D spiral).

Expand All @@ -60,7 +60,7 @@ console.log(outerDiameter);
//=> 3.0000000000272684
```

### `function rollInnerDiameter(h: number, d1: number, l: number): number`
### `function rollInnerDiameter(h: number, d1: number, l: number): number | undefined`

Calculates the inner diameter of a roll (2D spiral).

Expand All @@ -76,7 +76,7 @@ console.log(innerDiameter);
//=> 1.999999999959101
```

### `rollMaterialHeight(d0: number, d1: number, l: number): number`
### `rollMaterialHeight(d0: number, d1: number, l: number): number | undefined`

Calculates the nominal material height or thickness in a roll (2D Spiral).

Expand All @@ -96,3 +96,21 @@ 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.

```js
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
```

0 comments on commit 7dba28b

Please sign in to comment.