A Javascript Library to compute arbitrary resistor values from a set of given resistors. Supports drawing to SVG.
| imgs | ||
| modules | ||
| index.html | ||
| main.js | ||
| README.md | ||
ResistorJS
ResistorJS is a Javascript library intended to compose electronical resistors.
Using Resistors in Code
In order to instantiate an 100 Ohm resistor, we simply call new Resistor(100). In order to compose several resistors, the composite resistor types SeriesResistor and ParallelResistor are available.
var r1 = new Resistor(100);
var r2 = new Resistor(150);
var inSeries = r1.series(r2); // type: SeriesResistor
var inParallel = r1.parallel(r2); // type: ParallelResistor