Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import { IComplex, IComplexConstructor } from '../internal/complex'; import imagImpl from '../internal/imagImpl'; import mask from '../internal/mask'; import getImag from '../methods/getImag'; export default function imag<T extends IComplex>(Complex: IComplexConstructor<T>, z: IComplex | number, i = 0): T { const zImag = typeof z === 'number' ? imagImpl(z, i) : getImag(z); return new Complex( zImag, 0, Math.abs(zImag), zImag < 0 ? Math.PI : 0, mask.HAS_ALL ); } |