arcade-physics
Version:
Use Arcade Physics without Phaser.
30 lines • 1.11 kB
JavaScript
;
/**
* @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 Length_1 = __importDefault(require("../line/Length"));
/**
* Gets the length of the perimeter of the given triangle.
* Calculated by adding together the length of each of the three sides.
*
* @function Phaser.Geom.Triangle.Perimeter
* @since 3.0.0
*
* @param {Phaser.Geom.Triangle} triangle - The Triangle to get the length from.
*
* @return {number} The length of the Triangle.
*/
const Perimeter = triangle => {
const line1 = triangle.getLineA();
const line2 = triangle.getLineB();
const line3 = triangle.getLineC();
return (0, Length_1.default)(line1) + (0, Length_1.default)(line2) + (0, Length_1.default)(line3);
};
exports.default = Perimeter;
//# sourceMappingURL=Perimeter.js.map