hexo/node_modules/stylus/lib/functions/asin.js

22 lines
578 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
var utils = require('../utils')
, nodes = require('../nodes')
, convert = require('./convert-angle');
/**
* Return the arcsine of the given `value`.
*
* @param {Double} trigValue
* @param {Unit} output
* @return {Unit}
* @api public
*/
module.exports = function atan(trigValue, output) {
var output = typeof output !== 'undefined' ? output : 'deg';
var m = Math.pow(10, 9);
var value = Math.asin(trigValue) ;
var convertedValue = convert(value, output);
convertedValue = Math.round(convertedValue * m) / m;
return new nodes.Unit(convertedValue, output);
};