phaser/src/geom/line/NormalX.js

26 lines
598 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
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;