How to use the tan function from mathjs

Find comprehensive JavaScript mathjs.tan code examples handpicked from public code repositorys.

2
3
4
5
6
7
8
9
10
11
console.log(math.sin(2));  
console.log(math.cos(math.pi / 4));   
console.log(math.tan(0.5));  
console.log(math.sin(0.5) / math.cos(0.5));  
console.log(math.cot(2));   
console.log(1 / math.tan(2));  
console.log(math.sec(2));  
console.log(1 / math.cos(2));   
console.log(math.csc(2));   
console.log(1 / math.sin(2));   
fork icon19
star icon29
watch icon6

+ 5 other calls in file

18
19
20
21
22
23
24
25
26
27

//const TRIANGLE_UNIT_HEIGHT = math.divide(math.sqrt(bignumber("3")), bignumber("2"));

const GRADIENTS = {
    major_diag: math.tan(math.unit(120, "deg")),
    anti_diag: math.tan(math.unit(-120, "deg")),
    flat: bignumber("0"),
    is_valid(direction) {
        return (direction === this.major_diag || direction === this.anti_diag || direction === this.flat);
    },
fork icon1
star icon0
watch icon1

+ 3 other calls in file