UNPKG

arcade-physics

Version:
27 lines 958 B
"use strict"; /** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const const_1 = __importDefault(require("../../math/const")); const Angle_1 = __importDefault(require("./Angle")); /** * Returns the x component of the normal vector of the given line. * * @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} The x component of the normal vector of the line. */ const NormalX = line => { return Math.cos((0, Angle_1.default)(line) - const_1.default.TAU); }; exports.default = NormalX; //# sourceMappingURL=NormalX.js.map