Numworks Epsilon  1.4.1
Graphing Calculator Operating System
tangent.h
Go to the documentation of this file.
1 #ifndef POINCARE_TANGENT_H
2 #define POINCARE_TANGENT_H
3 
7 
8 
9 namespace Poincare {
10 
11 class Tangent : public StaticHierarchy<1> {
13 public:
14  Type type() const override;
15  Expression * clone() const override;
16  float characteristicXRange(Context & context, AngleUnit angleUnit = AngleUnit::Default) const override;
17 private:
18  /* Layout */
19  ExpressionLayout * privateCreateLayout(PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat) const override {
20  return LayoutEngine::createPrefixLayout(this, floatDisplayMode, complexFormat, name());
21  }
22  int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override {
23  return LayoutEngine::writePrefixExpressionTextInBuffer(this, buffer, bufferSize, numberOfSignificantDigits, name());
24  }
25  const char * name() const { return "tan"; }
26  /* Simplication */
27  Expression * shallowReduce(Context& context, AngleUnit angleUnit) override;
28  /* Evaluation */
29  template<typename T> static Complex<T> computeOnComplex(const Complex<T> c, AngleUnit angleUnit = AngleUnit::Radian);
30  Expression * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override {
31  return ApproximationEngine::map<float>(this, context, angleUnit,computeOnComplex<float>);
32  }
33  Expression * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override {
34  return ApproximationEngine::map<double>(this, context, angleUnit, computeOnComplex<double>);
35  }
36 };
37 
38 }
39 
40 #endif
Type type() const override
Definition: tangent.cpp:17
c(generic_all_nodes)
static ExpressionLayout * createPrefixLayout(const Expression *expression, PrintFloat::Mode floatDisplayMode, Expression::ComplexFormat complexFormat, const char *operatorName)
Expression * clone() const override
Definition: tangent.cpp:21
static int writePrefixExpressionTextInBuffer(const Expression *expression, char *buffer, int bufferSize, int numberOfDigits, const char *operatorName)
float characteristicXRange(Context &context, AngleUnit angleUnit=AngleUnit::Default) const override
Definition: tangent.cpp:26