Table of Contents
Cos
The Cos function returns the cosine of a numeric value. Cosine is a fundamental trigonometric function that describes the ratio between the adjacent side and the hypotenuse of a right triangle for a given angle. It is widely used in applications such as motion control, waveform generation, geometry, robotics, and any system that requires smooth periodic calculations.
On the Cubloc platform, all trigonometric functions—including Cos—use radians to measure angles. For the highest degree of precision, particularly when working with floating-point expressions or generating continuous motion profiles, it is recommended to use the Single data type for the input value.
Cos accepts any real number as an angle and returns a value in the range of –1.0 to +1.0, representing the cosine of that angle.
Example
A = Cos B ' Returns the cosine of angle B (in radians).
Explanation:
- B should contain an angle expressed in radians.
- Cos B calculates the cosine of that angle.
- The resulting value—typically used for scaling, rotation, or periodic motion computations—is stored in A.
Cosh
The Cosh function returns the hyperbolic cosine of a numeric value. Unlike the ordinary cosine function, which relates to circular motion and angles in a triangle, the hyperbolic cosine is based on the geometry of a hyperbola. It appears frequently in engineering, physics, signal processing, and mathematical modeling—especially in calculations involving exponential growth, smooth curve shaping, or systems governed by hyperbolic functions.
On the Cubloc platform, hyperbolic functions—including Cosh—use radians as the unit for the input value. For the most accurate results, particularly when dealing with fractional values or when chaining multiple mathematical operations, it is recommended to use the Single data type.
Cosh accepts any real number as input and always returns a value greater than or equal to 1.0, since the hyperbolic cosine never dips below 1.
Example
A = Cosh B ' Returns the hyperbolic cosine of B.
Explanation:
- B represents a real number, often used in equations describing smooth transitions or exponential-style curves.
- Cosh B computes the hyperbolic cosine using the standard definition. (e^{x}+ e^{-x}) / 2
- The resulting value is stored in A, ready for use in further calculations such as modeling motion profiles or generating mathematically smooth outputs.
