-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurface_coverage.R
More file actions
32 lines (24 loc) · 1.02 KB
/
surface_coverage.R
File metadata and controls
32 lines (24 loc) · 1.02 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
antennas <- read.csv("antennas.csv", header = TRUE, row.names = 1)
bodies <- read.csv("bodies.csv", header = TRUE, row.names = 1)
alttitude <- 200
# Assume the antenna can reach the sureface of the central body, then the arc on
# the surface formed by the two tangents passing through the satellite should
# have unobstrcted line of sight to the satellite.
#
# The percentage of surface covered can be calduated.
surface_coverage <- function(alttitude, body) {
# ratio of the surface covered
ratio <- acos(body$radius / (alttitude + body$radius)) / pi
# angle covered by the antenna crone
angle <- ratio * 180 * 2
# number of sattlites needed in a orbital plane
number <- ceiling(1 / ratio)
# radius of the orbit
radius <- body$radius + alttitude
# distance between to satellites in a orbital plane
distance <- sin(pi / number) * radius * 2
result <- cbind(ratio, angle, number, radius, distance)
rownames(result) <- rownames(body)
return(result)
}
surface_coverage(alttitude, bodies)