From f3379de81ebe9bedea6ac546be19e9b78bd8f0e9 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Thu, 28 Jun 2018 06:48:37 +1000 Subject: [PATCH] add formula to calculate pip speed not used yet, but will be used eventually --- src/app/shipyard/Calculations.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index 489f4e54..730d0c42 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -86,6 +86,16 @@ export function speed(mass, baseSpeed, thrusters, engpip) { return results; } +/** + * Calculate pip multiplier for speed. + * @param {number} topSpeed The top speed of ship in data + * @param {number} baseSpeed The base speed of ship in data + * @return {number} The multiplier that pips affect speed. + */ +export function calcPipSpeed(topSpeed, baseSpeed) { + return 1 - ((topSpeed - ((topSpeed - baseSpeed) / 4)) / topSpeed); +} + /** * Calculate pitch of a ship based on mass and thrusters * @param {number} mass the mass of the ship