Class TrigToExp

  • All Implemented Interfaces:
    IFunctionEvaluator, IEvaluator

    public class TrigToExp
    extends AbstractEvaluator
     TrigToExp(expr)
     

    converts trigonometric functions in expr to exponentials.

    Examples

     >> TrigToExp(Cos(x))
     1/2*E^(I*x)+1/2*E^(-I*x)
     
    • Constructor Detail

      • TrigToExp

        public TrigToExp()
    • Method Detail

      • expectedArgSize

        public int[] expectedArgSize​(IAST ast)
        Description copied from interface: IFunctionEvaluator
        At index 0 return the "from", at index 1 return the "to" number of arguments, which are expected by this function. If the returned int array has length 3, the function allows headers unequal to the built-in function name (i.e. the function can be in "operator form").
        Parameters:
        ast - the abstract syntax tree (AST) those arguments should be checked
        Returns:
        null if no range for the number of arguments is specified.
      • setUp

        public void setUp​(ISymbol newSymbol)
        Description copied from class: AbstractEvaluator
        Evaluate built-in rules and define Attributes for a function.
        Specified by:
        setUp in interface IEvaluator
        Overrides:
        setUp in class AbstractEvaluator
        Parameters:
        newSymbol - the symbol which should be set up