nerdamer-ts
Version:
javascript light-weight symbolic math expression evaluator
17 lines • 555 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.conjugate = void 0;
const Symbol_1 = require("../../../Types/Symbol");
const index_1 = require("../index");
/**
* Computes the conjugate of a complex number
* @param {Symbol} symbol
* @returns {Symbol}
*/
function conjugate(symbol) {
var re = symbol.realpart();
var im = symbol.imagpart();
return (0, index_1.add)(re, (0, index_1.multiply)(im.negate(), Symbol_1.Symbol.imaginary()));
}
exports.conjugate = conjugate;
//# sourceMappingURL=conjugate.js.map