#postscript("../../WriteUp/Graphics/Chapter2/chap_2_sect_3_prob_32_plot.eps", onefile=FALSE, horizontal=FALSE) thetas = seq( 0, pi/2, length.out=100 ) rhs = thetas - sin(thetas) + cos(thetas)/2 plot( thetas, rhs, type='l', xlab='angle (radians)', ylab='rhs(theta)' ) abline(h=1/2, col='red') grid() #dev.off() library(stats) f = function(a){ a - sin(a) + cos(a)/2 - 1/2 } res = uniroot( f, c(1.25, 1.5) ) t = res$root print( sprintf('theta= %f (radians)', t) ) k = sqrt( 2/(t-sin(t)) ) print( sprintf('k= %f', k) )