The trigonometric functions are very useful if you were in the computer graphics industry ,or you are writing a simulation program for weather forecasts, continued fractions, and so on. OpenCL provides the usual suspects when it comes to the trigonometry support with `cos`

, `acos`

, `sin`

, `asin`

, `tan`

, `atan`

, `atanh`

(hyperbolic arc tangent), `sinh`

(hyperbolic sine), and so on.

In this section, we will take a look at the popular trigonometric identity function:

*sin2 + cos2 = 1*

From the Pythagoras's theorem, we understood that a right-angled triangle with sides *a*,*b*,*c* and angle *t* at the vertex where *a* and *c* meet, *cos(t)* is by definition *a*/*c*, *sin(t*
`)`

is by definition *b*/*c*, and so *cos2(t) + sin2(t) = (a/c)2 + (b/c)2* when combined with ...

Start Free Trial

No credit card required