I had searched on the internet and I could not find the method of the Math
object that returns the ctg
and arcctg
of an angle. Is there such a method or should I just create my own function using these mathematical formulas:
Asked
Active
Viewed 1.2k times
12

s.dragos
- 582
- 2
- 8
- 24
-
1you may have a look into the docs for [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math) (some methods may not be working on IE) – Nina Scholz Aug 31 '16 at 08:25
-
You should create your own functions. – Ivan Z Jan 27 '19 at 16:32
1 Answers
25
There is not, and if you want them you will have to define them yourself. Fortunately, they are easy:
function ctg(x) { return 1 / Math.tan(x); }
function arcctg(x) { return Math.PI / 2 - Math.atan(x); }

Amadan
- 191,408
- 23
- 240
- 301