# Sin()-function and radians()-function implemented in processing.1.4.16.js?

**URL:** <https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729>\
**Category:** Beginners\
**Created:** [June 27, 2022, 11:41am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729 "2022-06-27T11:41:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)\
**Post date:** [June 27, 2022, 11:41am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/1 "2022-06-27T11:41:25Z")

</div>

Hello to all,

I read a bit about the potential difficulties to work with processing.js but so far luckily did not encounter any problem. Only just now it occurs that the sin()-function, probabily also the radians()-function are not implemented neither in processing.1.4.16.js, nor in versions 1.6.0 and 1.6.6 (these three are the versions of processing.js that I could find on the net).

My question is: can anyone help with a version of processing.js that supports those functions or does anyone know about a work-around?

I would be grateful for any help!

All the best,  
Andreas

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 27, 2022, 11:44am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/2 "2022-06-27T11:44:38Z")

</div>

> [@anrui71](#):
>
> Only just now it occurs that the sin()-function, probabily also the radians()-function are not implemented neither in processing.1.4.16.js,

[GoToLoop.GitHub.io/processing-js.github.io/reference/sin\_/](http://GoToLoop.GitHub.io/processing-js.github.io/reference/sin_/)  
[GoToLoop.GitHub.io/processing-js.github.io/reference/radians\_/](http://GoToLoop.GitHub.io/processing-js.github.io/reference/radians_/)  
[GoToLoop.GitHub.io/processing-js.github.io/tools/processing-helper.html](http://GoToLoop.GitHub.io/processing-js.github.io/tools/processing-helper.html)

---

<div class="post-metadata">

**Author:** ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)\
**Post date:** [June 28, 2022, 5:26am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/3 "2022-06-28T05:26:29Z")

</div>

GoToLoop, thank you for the three links! So sin() and radians() a r e implemented!! Yet, it is the following line of code that works fine within the processing player but does not work work when playing the pde with processing.js in a browser:

```
  float sin = sin(radians(90-(180/enti)*counter))

```

Whereby enti is a float with value 1800, and counter, also a float, can take values in a range from 0 to 599 (so that the whole expression within radians can take values in a range from 0 to 30.1).  
When skipping the line resp. when simply initialising sin with an int, the pde runs fine in the browser…

Can’t see where the problem is. Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 28, 2022, 5:46am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/4 "2022-06-28T05:46:55Z")

</div>

> [@anrui71](#):
>
> `float sin =`

You’re replacing/re-assigning **sin()** function w/ another value there!  
Use some other variable name instead of _sin_!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 28, 2022, 7:13am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/5 "2022-06-28T07:13:37Z")

</div>

> [@anrui71](#):
>
> `float sin = sin(radians(`

float sinValue= sin(radians(…

---

<div class="post-metadata">

**Author:** ![anrui71](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anrui71](https://discourse.processing.org/u/anrui71)\
**Post date:** [June 29, 2022, 6:12am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729/6 "2022-06-29T06:12:58Z")

</div>

It works fine now!!

So here’s a difference in acceptance: processing itself knows to differenciate between sin and sin(). Happy to have a solution now, thank you very much GoToLoop and Chrisir!!
