complete redesign: use nodejs on server instead of php - documentation to be updated

This commit is contained in:
Marc Wäckerlin
2016-01-10 23:17:30 +00:00
parent 1c3765955b
commit a56d3118de
1376 changed files with 183732 additions and 1253 deletions

28
nodejs/node_modules/stylus/lib/functions/tan.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
var utils = require('../utils')
, nodes = require('../nodes');
/**
* Return the tangent of the given `angle`.
*
* @param {Unit} angle
* @return {Unit}
* @api public
*/
module.exports = function tan(angle) {
utils.assertType(angle, 'unit', 'angle');
var radians = angle.val;
if (angle.type === 'deg') {
radians *= Math.PI / 180;
}
var m = Math.pow(10, 9);
var sin = Math.round(Math.sin(radians) * m) / m
, cos = Math.round(Math.cos(radians) * m) / m
, tan = Math.round(m * sin / cos ) / m;
return new nodes.Unit(tan, '');
};