Sass trigonometry and inverse trigonometry functions.
npm install sass-trigonometry


Sass trigonometry and inverse trigonometry functions.
Expand Sass function with pure Sass trigonometry functions : pi , deg-to-rad, rad-to-deg , sin , cos , tan , asin , acos and atan.
And with some usefull math functions : pow, fact and sqrt.
It could allows to dynamicly calculate angle in pure sass.
Using npm
``bash`
npm install --save sass-trigonometry
Using yarn
`bash`
yarn add sass-trigonometry
`scss`
@import "~sass-trigonometry";
_Example:_
`scss`
$pio2: pi() / 2;
Sine, Cosine and Tangent trigonometry functions.
_Example_
`scss`
sin(45deg); // => 0.7071...
cos(30deg); // => 0.8660...
tan(60deg); // => 1.7320...
Arcsine, Arccosine and Arctangent inverted trigonometry functions.
_Example_
`scss`
asin(0.7071); // => 45
acos(0.8660); // => 30
atan(1.7320); // => 60
Power, Factorial and Square-root functions
_Example_
`scss`
pow(10, 2); // => 100
fact(5); // => 120
sqrt(100); // => 10
`scss
@import "~sass-trigonometry";
$width: 200;
$height: 150;
$diagonal-width: sqrt(pow($width, 2) + pow($height, 2));
$diagonal-angle: atan($height / $width);
#triangle {
position: relative;
height: #{$height}px;
width: #{$width}px;
border-bottom: 1px solid red;
border-left: 1px solid red;
&:before {
border-top: 1px solid red;
content: "";
left: 0;
position: absolute;
top: $height;
transform-origin: left;
transform: rotate(#{$diagonal-angle}deg);
width: #{$diagonal-width}px;
}
}
``