UNPKG

@rayyamhk/complex

Version:

A lightweight and easy-to-use library for you to manipulate complex numbers

18 lines (15 loc) 400 B
"use strict"; /** * Calculates the complex conjugate of the Complex Number. * @memberof Complex * @static * @param {Complex} num - Complex number * @returns {Complex} The complex conjugate of the Complex Number */ function conjugate(num) { if (!(num instanceof this)) { return this.NaN; } return new this(num.getReal(), num.getImaginary() * -1); } module.exports = conjugate;