UNPKG

@phaserjs/phaser

Version:
10 lines (9 loc) 288 B
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ export function GetLinePerpSlope(line) { const { x1, y1, x2, y2 } = line; return -((x2 - x1) / (y2 - y1)); }