# Values for which to evaluate density
theta <- c(1:500) * 2 * pi / 500
# Compute wrapped normal density function
density <- c(1:500)
for(i in 1:500) {
density[i] <- dwrpnorm2(theta[i], pi, .75)
}
if (interactive()) {
plot(theta, density)
}
# Approximate area under density curve
sum(density * 2 * pi / 500)
Run the code above in your browser using DataLab