phaser/src/geom/line/NormalX.js

26 lines
572 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2019-01-15 16:20:22 +00:00
* @copyright 2019 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
2017-01-04 00:21:42 +00:00
var MATH_CONST = require('../../math/const');
var Angle = require('./Angle');
2017-10-13 13:11:54 +00:00
/**
* [description]
*
* @function Phaser.Geom.Line.NormalX
* @since 3.0.0
*
2018-09-24 22:20:43 +00:00
* @param {Phaser.Geom.Line} line - The Line object to get the normal value from.
2017-10-13 13:11:54 +00:00
*
* @return {number} [description]
*/
2017-01-04 00:21:42 +00:00
var NormalX = function (line)
{
return Math.cos(Angle(line) - MATH_CONST.TAU);
};
module.exports = NormalX;