UNPKG

arcade-physics

Version:
28 lines 990 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")); /** * The Y value of the normal of the given line. * The normal of a line is a vector that points perpendicular from it. * * @function Phaser.Geom.Line.NormalY * @since 3.0.0 * * @param {Phaser.Geom.Line} line - The line to calculate the normal of. * * @return {number} The Y value of the normal of the Line. */ const NormalY = line => { return Math.sin((0, Angle_1.default)(line) - const_1.default.TAU); }; exports.default = NormalY; //# sourceMappingURL=NormalY.js.map