# Create Unit Circle with its Sin Cos Animation

**URL:** <https://discourse.julialang.org/t/create-unit-circle-with-its-sin-cos-animation/83467>\
**Category:** General Usage\
**Created:** [June 28, 2022, 3:30pm UTC](https://discourse.julialang.org/t/create-unit-circle-with-its-sin-cos-animation/83467 "2022-06-28T15:30:29Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [June 30, 2022, 3:11pm UTC](https://discourse.julialang.org/t/create-unit-circle-with-its-sin-cos-animation/83467/21 "2022-06-30T15:11:21Z")

</div>

The `mod1()` function might be useful.

```julia
julia> mod1(180 + 181, 360)
1

```

Also, this code:

```julia
setfont("Georgia Bold", 73)
...
 text(string("sin $k")

```

is mixing the two Cairo text APIs and so won’t work the way you think.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [June 30, 2022, 3:33pm UTC](https://discourse.julialang.org/t/create-unit-circle-with-its-sin-cos-animation/83467/22 "2022-06-30T15:33:57Z")

</div>

@cormullion

thanks for that `mod1()` function. You are an expert that is really active in Julia language.  
it works as expected now… I was looking at the wrong place all this time thought the answer is using while and for loop.

[Previous page](https://discourse.julialang.org/t/create-unit-circle-with-its-sin-cos-animation/83467.md?page=1)
