Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 2.44 KB

qsp-functions.heta.md

File metadata and controls

96 lines (69 loc) · 2.44 KB

qsp-functions.heta

The qsp-functions.heta file serves as a container for additional custom functions that can be used within Heta platforms.

Overview

  • Location: This file is automatically generated when you run the heta init command and can be found in the src directory of your project.
  • Integration: A reference to this file is included in the index.heta file, ensuring these functions are available within your Heta project.

Defining Custom Functions

Heta provides the flexibility to define your own functions. For details on how to create custom functions, refer to the #defineFunction specification.

Included Functions

The qsp-functions.heta file contains a curated list of additional functions specifically tailored for Heta platforms. These functions are not part of the base function list, but they extend the platform's functionality.

Best Practices

  1. Organize new functions in dedicated files or include them in the main index.heta for better maintainability.
  2. Keep the qsp-functions.heta file intact to ensure a consistent and predictable setup for your project.

Content

/*
    Additional functions which can be used in Heta platforms
    can be added to index file by include ./qsp-functions.heta;
*/

// hyperbolic functions

#defineFunction sinh {
    arguments: [x],
    math: "0.5 * (exp(x) - exp(-x))"
};

#defineFunction cosh {
    arguments: [x],
    math: "0.5 * (exp(x) + exp(-x))"
};

#defineFunction tanh {
    arguments: [x],
    math: "(exp(2 * x) - 1) / (exp(2 * x) + 1)"
};

#defineFunction sech {
    arguments: [x],
    math: "1 / cosh(x)"
};

#defineFunction csch {
    arguments: [x],
    math: "1 / sinh(x)"
};

#defineFunction coth {
    arguments: [x],
    math: "1 / tanh(x)"
};


// inverse hyperbolic functions

#defineFunction arcsinh {
    arguments: [x],
    math: "ln(x + sqrt(x^2 + 1))"
};

#defineFunction arccosh {
    arguments: [x],
    math: "ln(x + sqrt(x^2 - 1))"
};

#defineFunction arctanh {
    arguments: [x],
    math: "0.5 * ln((1 + x) / (1 - x))"
};

#defineFunction arcsech {
    arguments: [x],
    math: "ln((1 + sqrt(1 - x^2)) / x)"
};

#defineFunction arccsch {
    arguments: [x],
    math: "ln(1 / x + sqrt(1 + 1 / x^2))"
};

#defineFunction arccoth {
    arguments: [x],
    math: "0.5 * ln((x + 1) / (x - 1))"
};