mirror of
https://github.com/photonstorm/phaser
synced 2025-01-08 03:08:50 +00:00
25 lines
598 B
JavaScript
25 lines
598 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
*/
|
|
|
|
var MATH_CONST = require('../../math/const');
|
|
var Angle = require('./Angle');
|
|
|
|
/**
|
|
* [description]
|
|
*
|
|
* @function Phaser.Geom.Line.NormalX
|
|
* @since 3.0.0
|
|
*
|
|
* @param {Phaser.Geom.Line} line - The Line object to get the normal value from.
|
|
*
|
|
* @return {number} [description]
|
|
*/
|
|
var NormalX = function (line)
|
|
{
|
|
return Math.cos(Angle(line) - MATH_CONST.TAU);
|
|
};
|
|
|
|
module.exports = NormalX;
|