forked from simsum/oscat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTRO.EXP
executable file
·66 lines (54 loc) · 1.36 KB
/
ASTRO.EXP
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
59
60
61
62
63
64
65
66
(* @NESTEDCOMMENTS := 'Yes' *)
(* @PATH := '\/Engineering\/conversion' *)
(* @OBJECTFLAGS := '0, 8' *)
(* @SYMFILEFLAGS := '2048' *)
FUNCTION_BLOCK ASTRO
VAR_INPUT
m : REAL;
AE : REAL;
PC : REAL;
LJ : REAL;
END_VAR
VAR_OUTPUT
Ym : REAL;
YAE : REAL;
YPC : REAL;
YLJ : REAL;
END_VAR
(*
version 1.1 11. mar. 2009
programmer hugo
tested by oscat
this function converts different length units
any unused input can simply be left open.
different inputs connected at the same time will be added up.
*)
(* @END_DECLARATION := '0' *)
YAE := AE
+ m * 6.6845871535E-012
+ PC * 206265.0
+ LJ * 63240.0;
Ym := YAE * 149.597870E9;
YPC := YAE * 4.8481322570E-006;
YLJ := YAE * 1.5812776724E-005;
(*
Länge Meter m SI-Basiseinheit
Astronomische Einheit* AE 1 AE = 149,597 870 · E9 m
Parsec pc 1 pc = 206265 AE = 30,857 · E15 m
Lichtjahr Lj 1 Lj = 9,460 530 · E15 m = 63240 AE = 0,306 59 pc
Ångström Å 1 Å = E–l0 m
typograph. Punkt p 1 p = 0,376 065 mm • im Druckereigewerbe
inch** in 1 in = 2,54 · E–2 m = 25,4 mm***
foot ft 1 ft = 0,3048 m = 30,48 cm
yard yd 1 yd = 0,9144 m
mile mile 1 mile = 1609,344 m
Internat. Seemeile sm 1 sm = 1852 m
Fathom fm 1 fm = 1,829 m • in der Seeschifffahrt
*)
(* revision history
hm 27. mar. 2007 rev 1.0
original version
hm 11. mar. 2009 rev 1.1
improved code
*)
END_FUNCTION_BLOCK