Chalkboard - v3.0.1
    Preparing search index...

    Function define

    • Defines a mathematical function in the field of complex numbers.

      Parameters

      • ...rule: (
            | ((z: ChalkboardComplex) => ChalkboardComplex)
            | ((a: number, b: number) => number)
        )[]

        The rule of the function, which can be a single function that takes a complex number or an array of two functions that take real and imaginary parts respectively.

      Returns ChalkboardFunction

      // Defines f(z) = z² or f(a+bi) = (a²-b²) + (2ab)i
      const f = Chalkboard.comp.define((z) => Chalkboard.comp.sq(z));

      // Defines g(a+bi) = (a²-b²) + (2ab)i or g(z) = z²
      const g = Chalkboard.comp.define([
      (a, b) => a*a - b*b,
      (a, b) => 2*a*b
      ]);