/** * Represents a complex number `a + bi`. */ export declare class Complex { readonly real: number; readonly imag: number; /** * Magnitude of the complex number. */ readonly r: number; /** * Angle of the complex number. */ readonly theta: number; /** * Define a complex number `a + bi`. * @param real The real portion. * @param imag The imaginary portion. */ constructor(real: number, imag: number); /** * Create a complex number from polar coordinates. * @param r The magnitude (radius). * @param theta The angle in radians. * @returns A complex number represented by `r * e^{i theta}`. */ static fromPolar(r: number, theta: number): Complex; /** * Determine whether this complex number is equal to another. * @param other The other complex number to compare. * @param tolerance Optional tolerance for approximate equality. * @returns `true` when both real and imaginary components are equal within tolerance. */ equals(other: Complex, tolerance?: number): boolean; /** * Add another complex number to this one. * @param other The complex number to add. * @returns The sum of the two complex numbers. */ plus(other: Complex): Complex; /** * Subtract another complex number from this one. * @param other The complex number to subtract. * @returns The difference of the two complex numbers. */ minus(other: Complex): Complex; /** * Multiply this complex number by another. * @param other The complex number to multiply with. * @returns The product of the two complex numbers. */ times(other: Complex): Complex; /** * Divide this complex number by another. * @param other The complex number to divide by. * @returns The quotient of the two complex numbers. */ over(other: Complex): Complex; /** * Raise this complex number to a power. * @param exp The exponent. * @returns The complex number raised to the given power. */ pow(exp: number): Complex; }