Commit bdf67e7a authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

#205 - Jet: omit extra results if calculation failed

parent 43a83350
......@@ -25,24 +25,27 @@ export class Jet extends Nub {
public Calc(sVarCalc: string, rInit?: number): Result {
this.currentResult = super.Calc(sVarCalc, rInit);
// H: chute
this.result.resultElement.values.H = this.prms.ZJ.v - this.prms.ZW.v;
// Y: profondeur
this.result.resultElement.values.Y = this.prms.ZW.v - this.prms.ZF.v;
// YH: rapport profondeur/chute
this.result.resultElement.values.YH = this.result.resultElement.values.Y / this.result.resultElement.values.H;
// t: temps de vol
this.result.resultElement.values.t = this.prms.D.V / Math.cos(this.alpha) / this.prms.V0.V;
// Vx: vitesse horizontale à l'impact
this.result.resultElement.values.Vx = this.prms.V0.V * Math.cos(this.alpha);
// Vz: vitesse verticale à l'impact
this.result.resultElement.values.Vz =
this.prms.V0.V * Math.sin(this.alpha) - this.result.resultElement.values.t * 9.81;
// Vt: vitesse à l'impact
this.result.resultElement.values.Vt = Math.sqrt(
Math.pow(this.result.resultElement.values.Vx, 2)
+ Math.pow(this.result.resultElement.values.Vz, 2)
);
// omit extra results if calculation failed
if (this.result.vCalc !== undefined) {
// H: chute
this.result.resultElement.values.H = this.prms.ZJ.v - this.prms.ZW.v;
// Y: profondeur
this.result.resultElement.values.Y = this.prms.ZW.v - this.prms.ZF.v;
// YH: rapport profondeur/chute
this.result.resultElement.values.YH = this.result.resultElement.values.Y / this.result.resultElement.values.H;
// t: temps de vol
this.result.resultElement.values.t = this.prms.D.V / Math.cos(this.alpha) / this.prms.V0.V;
// Vx: vitesse horizontale à l'impact
this.result.resultElement.values.Vx = this.prms.V0.V * Math.cos(this.alpha);
// Vz: vitesse verticale à l'impact
this.result.resultElement.values.Vz =
this.prms.V0.V * Math.sin(this.alpha) - this.result.resultElement.values.t * 9.81;
// Vt: vitesse à l'impact
this.result.resultElement.values.Vt = Math.sqrt(
Math.pow(this.result.resultElement.values.Vx, 2)
+ Math.pow(this.result.resultElement.values.Vz, 2)
);
}
let ZF = this.prms.ZF.v;
let ZW = this.prms.ZW.v;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment