21/03/02 21:03:00.48 EygxTbXG.net
# 20cm×10cmの楕円形ステーキを2:1に分割
steak_cut <- function(phi=2,a=20/2,b=10/2){
eclps <- function(x) b*sqrt(a^2-x^2)/a
f <- function(x) integrate(eclps,-a,x)$value
xcut=uniroot(function(x) f(x)- (pi*a*b/2)*(phi/(1+phi)),c(-a,a))$root
Plot(-a,a,-b,b,bty='n')
x=seq(-a,a,0.05)
y=b*sqrt(a^2-x^2)/a
lines(x,y,col=2,type='h',lwd=3); lines(x,-y,col=2,type='h',lwd=3)
seg(xcut-1i*eclps(xcut),xcut+1i*eclps(xcut),lty=4)
c(x=xcut,length=2*eclps(xcut))
}
steak_cut(2,20/2,10/2)