Consider a large square of side a containing a small circle of radius r.
library(dplyr); library(ggplot2); library(ggsci); library(magrittr); library(reshape2)
a = 1 #for standardization
r = .01 # base radius
incrs = seq(0, 1, len = 10)
rs = r*(1+incrs)
cbase = pi*r^2
lbase = 2*r
circular = vector()
linear = vector()
for(i in 1:length(rs)){
circular[i] = pi*rs[i]^2 / cbase - 1
linear[i] = 2*rs[i] / lbase - 1
}
result = data.frame(rs, circular, linear, incrs)
theme_set(theme_minimal())
result %>% select(incrs, circular, linear) %>% melt(id.vars = incrs) %>%
ggplot(aes(x = incrs, y = value, color = variable)) +
geom_line() + scale_color_startrek() + scale_y_continuous(labels = scales::percent) +
labs(color = "Search Type") + xlab("Increase in Target Area from Baseline") +
ylab("Increase in Pd from baseline") +
scale_x_continuous(labels = scales::percent) +
ggtitle("Comparison of linear vs. circular search vs convoy size")