js-electrical-engineering-equations
Version:
This is an ES6/ES2015 library of Electrical Engineering Equations. It works with Typescript, es6, and es5.
49 lines (39 loc) • 1.75 kB
JavaScript
;
/**
* TankCircuit is a class with methods that can be used without initializing.
*
* Its methods provide calculations for a Tank Circuit (LC), (Inductor and Capacitor) resonant circuit.
*
* @example
*
* RCCircuit.lowPassFilter(1000, 1 / 100000000);
*
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var RCCircuit = function () {
function RCCircuit() {
_classCallCheck(this, RCCircuit);
}
_createClass(RCCircuit, null, [{
key: 'lowPassFilter',
/**
*
* Take a value of resistance in ohms and value of capacitance in farads and calculates the
* cut off frequency of a low-pass circuit. The return value is in hertz.
*
* @param {number} resistance
* @param {number} capacitance
* @returns {number}
*/
value: function lowPassFilter(resistance, capacitance) {
return 1 / (2 * Math.PI * resistance * capacitance);
}
}]);
return RCCircuit;
}();
exports.default = RCCircuit;
module.exports = exports['default'];