-
Notifications
You must be signed in to change notification settings - Fork 1
/
distance_to_horizon.txt
59 lines (45 loc) · 2.73 KB
/
distance_to_horizon.txt
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
# Distance to the horizon from the "crow's nest"
# ==============================================
#
# Damien Graux (Inria), 2022
# This file provides a SPARQL set of bindings used to compute the
# distance to the horizon considering an observator located at a
# certain height from the ground.
# Earth's radius, in km.
BIND ( xsd:double("6371") AS ?E_radius )
# Factor accounting for the atmospheric refraction.
BIND (xsd:double("0.8279") AS ?b )
# [Inputs] It assumes that the distance to the horizon wants to be
# calculated for a the height ?h (should be in kilometers too).
# [Output] The result will be stored in ?distance.
# [Warning] The following variables are introduced in the following
# block: ?h, ?E_radius, ?b, ?X, ?sub1, ?sub2, ?distance. Please make
# sure not to create conflicts with existing variables of yours!
# [Note] The following bindings are making use of developments in
# series to approximate some mathematical functions. Practically, we
# use here the first 7 terms of the series.
######################################################################
############## BEGINNING OF GENERATED SPARQL BINDINGS ##############
BIND ( ( FLOOR((2*?E_radius*xsd:double(?h)/?b)*100000)/100000 ) AS ?X )
BIND ((0+(1*((?X-1)/(?X+1)))/1.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/3.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/5.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/7.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/9.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/11.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/13.0
+(1*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1))*((?X-1)/(?X+1)))/15.0
)AS ?sub1)
BIND ((0+(1)/1.0
+(1*?sub1)/1.0
+(1*?sub1*?sub1)/2.0
+(1*?sub1*?sub1*?sub1)/6.0
+(1*?sub1*?sub1*?sub1*?sub1)/24.0
+(1*?sub1*?sub1*?sub1*?sub1*?sub1)/120.0
+(1*?sub1*?sub1*?sub1*?sub1*?sub1*?sub1)/720.0
+(1*?sub1*?sub1*?sub1*?sub1*?sub1*?sub1*?sub1)/5040.0
)AS ?sub2)
BIND ( ( FLOOR((?sub2)*100000)/100000 ) AS ?distance )
### END OF BINDINGS
### result variable: ?distance
######################################################################