-
-
Notifications
You must be signed in to change notification settings - Fork 30
Trigonometry
Arthur Guiot edited this page Sep 8, 2018
·
3 revisions
I won't go and describe each function because there are too much of them, but here is the Wikipedia article.
Here is how they work:
t.[func](x) // y (replace [func] and x)
List of all functions:
- acos
- acosh
- asin
- asinh
- atan
- atan2
- atanh
- acos
- acosh
- cos
- cosh
- sin
- sinh
- tan
- tanh
The following functions will accept and return complex numbers:
- cos
- sin
- tan
- cosh
- sinh
- tanh
You can transform any angle to a vector using t.angle2Vec
:
t.angle2Vec(1) // [ 0.5403023058681398, 0.8414709848078965 ]
TheoremJS uses radian, so to convert degrees to them, you'll need to do this:
t.deg2rad(90) // pi / 2 => BigNumber
You can also to the opposite:
t.rad2deg(t.pi().div(2)) // 90 => BigNumber
If you want to draw points around a circle (it might be helpful with Descartes), you can use that:
t.drawCircularPoints(n, r=1, start=[-r, 0]) // where n is the number of points, r the radius, and start the interval
Any questions? Don't hesitate to create an issue and tell me about your problem 😊.
Copyright © 2017-2018 Arthur Guiot