radius <- 115
short <- 80
long <- 100
circleBoxInt(R=radius,S=short,L=long)
## not run
## the integral is the area inside the polygon
# \donttest{
x <- seq(0,max(radius,long),length=100)
outlineY <- function(x,R,S,L){
suppressWarnings(y <- sqrt(R^2-x^2))
y[x>R] <- 0
y[x>L] <- 0
y[y>=S] <- S
return(y)
}
y <- outlineY(x=x,R=radius,S=short,L=long)
plot(x,y,type='l',ylim=c(-10,short))
text(long,0,label='L',pos=1)
text(0,short,label='S',pos=1)
text(long,sqrt(radius^2-long^2),label='B',pos=4)
# }
Run the code above in your browser using DataLab