-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISA.PAS
More file actions
58 lines (52 loc) · 1.36 KB
/
ISA.PAS
File metadata and controls
58 lines (52 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2025
@website(https://www.gladir.com/avionix)
@abstract(Target: Turbo Pascal, Free Pascal)
}
Program ISA;
Uses Crt;
Const
P0=1013.25; { Pression au niveau de la mer (hPa) }
H0=44330.0; { Facteur de conversion }
Var
P,H:Real;
Err:Word;
Function Power(Base,Exponent:Real):Real;Begin
Power:=Exp(Exponent*Ln(Base));
End;
BEGIN
{$IFDEF FPC}
{$IFDEF WINDOWS}
SetUseACP(False);
{$ENDIF}
{$ENDIF}
If(ParamStr(1)='/?')or(ParamStr(1)='--help')or(ParamStr(1)='-h')or
(ParamStr(1)='/h')or(ParamStr(1)='/H')Then Begin
WriteLn('ISA : Cette commande permet de calculer l''altitude de pression (ISA).');
WriteLn;
WriteLn('Syntaxe : ISA [p]');
WriteLn;
WriteLn(' p Ce paramŠtre permet d''indiquer la pression atmosph‚rique (hPa)');
End
Else
If ParamCount>0 Then Begin
Val(ParamStr(1),P,Err);
If Err>0 Then Begin
WriteLn('La pression atmosph‚rique n''est pas valide');
Halt(1);
End;
H:=H0*(1 - Power(P / P0, 0.1903));
Writeln('Altitude de pression estim‚e : ', H:0:2, ' m');
End
Else
Begin
Clrscr;
WriteLn('Calcul de l''altitude de pression (ISA)');
writeLn('-------------------------------------');
Write('Entrez la pression atmosph‚rique (hPa) : ');
ReadLn(P);
H:=H0*(1 - Power(P / P0, 0.1903));
Writeln('Altitude de pression estim‚e : ', H:0:2, ' m');
ReadLn;
End;
END.