# Why an Angles.jl package is NOT a great idea

**URL:** <https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973>\
**Category:** Community\
**Tags:** question, unitful\
**Created:** [July 20, 2017, 11:56am UTC](https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973 "2017-07-20T11:56:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [July 20, 2017, 11:56am UTC](https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973/1 "2017-07-20T11:56:13Z")

</div>

So, after writing the [Angles.jl package](https://github.com/yakir12/Angles.jl/), and getting excited about it, I think I finally understand why it’s not such a great idea. But I would love to hear your opinions and thought about it.

The main reason not to have such a package is that **it is unclear when an angle stops being an angle** (apart from when you’ve run, for example, `sin` on it). Currently, the user needs to specifically extract the value out of the `Angle` subtype to stop it from being an angle.

There are two other ways to approach this (I think):

1. Just use `Unitful.jl`. Angles exist there within the context of units: they might get canceled out, they might propagate through the whole calculation _as intended_, or you can purposefully strip off the unit and get their value.
2. Have angles magically act exactly like any subtype of `Number`. You’d never need to even care if they stopped being an angle or not.

Since option #2 is not practical now (and might not even be in the future), it seems to me that I should instead add more “angular things” to `Unitful.jl` (if even needed), rather than hold this one unit separate from the others.

What do you think?

---

<div class="post-metadata">

**Author:** ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)\
**Post date:** [July 20, 2017, 12:37pm UTC](https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973/2 "2017-07-20T12:37:52Z")

</div>

I would think the useful part of having an angle type would be to actually limit what you can do with them: add, subtract, sin, cos, etc., so you get an error at compliation if you make a typo, or accidentally pass a number into a function that requires an angle. That might be useful. Having them act like real numbers would actually just be weird, in my opinion. 🙂 Multiplying angles is just a mathematical convenience that you can exploit for series expansions, but not something that is really “angle-like”.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [July 20, 2017, 12:49pm UTC](https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973/3 "2017-07-20T12:49:06Z")

</div>

I like the idea of integrating it into Unitful. It seems that some functionality already existed there anyway:

```julia
using Unitful: °,rad
sin(45°) # 0.7071
sin(π/4*rad) # 0.7071
45°-π/4 # 0.0

```

---

<div class="post-metadata">

**Author:** ![shorty66](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shorty66/32/3254_2.png) [@shorty66](https://discourse.julialang.org/u/shorty66)\
**Post date:** [July 20, 2017, 12:49pm UTC](https://discourse.julialang.org/t/why-an-angles-jl-package-is-not-a-great-idea/4973/4 "2017-07-20T12:49:15Z")

</div>

I think Unitful.jl is the way to go. Packages live by manpower and fragmentation will not help with that.
