- 底辺私立医大を卒業した医者って頭悪いよね? Part17
312 :卵の名無しさん[sage]:2020/07/30(木) 00:42:57.06 ID:Pwc04S3w - rm(list=ls())
library(gmp) dec2nw <- function(num, N, digit = 4){ r=num%%N q=num%/%N while(q > 0 | digit > 1){ r=append(q%%N,r) q=q%/%N digit=digit-1 } return(r) } is.plus<-function(x) (sum(x)+sum(x-1))>0 # is plus balance? fn <- function(n){ balance=0 for(i in 1:(2^n)){ balance=balance+is.plus(dec2nw(i-1,2,n)) } p=as.bigq(balance/2^n) list(p,as.numeric(p)) } fn(8) n=1:15*2 re=lapply(n,fn)
| - 底辺私立医大を卒業した医者って頭悪いよね? Part17
318 :卵の名無しさん[sage]:2020/07/30(木) 18:39:51.79 ID:Pwc04S3w - # https://i.imgur.com/sq3AWZr.png
# TWG <- function(theta){ # Tilted Wine Glass (0<= theta < pi/4) f<-function(x,z) -cos(sqrt(x^2+z^2)) # curved surface of wine glass f=Vectorize(f) df <- function(x,z0=0) (x*sin(sqrt(x^2 + z0^2)))/sqrt(x^2 + z0^2) # f' df=Vectorize(df) # (x0,y0) upper coordinates of wine x0=uniroot(function(x) df(x)-tan(theta),c(pi/2,pi+1e-12),tol=1e-12)$root y0=f(x0,0) # (u0x,u0y) lower coordinates of wine u0x=uniroot(function(x,z0=0) tan(theta)*(x-x0)+y0+cos(sqrt(x^2+z0^2)), c(-pi,pi/4))$root u0y=f(u0x,0) moon <- function(m,r=1){ # return area of demi-circle above y=m x1= -sqrt(r^2-m^2) x2= sqrt(r^2-m^2) if(m>0) { a=function(x) sqrt(r^2-x^2)-m integrate(a,x1,x2)$value }else{ b=function(x) m+sqrt(r^2-x^2) pi*r^2-integrate(b,x1,x2)$value } }
| - 底辺私立医大を卒業した医者って頭悪いよね? Part17
319 :卵の名無しさん[sage]:2020/07/30(木) 18:40:15.47 ID:Pwc04S3w - area <- function(t){ # when y=t
r=acos(-t) # t -> radius xL=(t-y0)/tan(theta)+ x0 # surface border if(t>u0y){ # defected moon moon(xL,r) }else{ return(pi*r^2) # full moon } } Area=Vectorize(area) integrate(Area, -1,y0)$value } TWG(0) TWG(pi/19) WG <- function(deg) TWG(deg*pi/180) WG(0) WG(9)/WG(0) WG(10)/WG(0) WG=Vectorize(WG) uniroot(function(x) WG(x)/WG(0)-1/2,c(9,10))$root
| - 底辺私立医大を卒業した医者って頭悪いよね? Part17
320 :卵の名無しさん[sage]:2020/07/30(木) 21:24:51.71 ID:Pwc04S3w - tan(θ)*(x-pi+asin(tan(θ)))+cos(asin(tan(θ)))+cos(x)=0
θは定数でxについて解く必要がある。
| - 底辺私立医大を卒業した医者って頭悪いよね? Part17
321 :卵の名無しさん[sage]:2020/07/30(木) 21:34:30.35 ID:Pwc04S3w - >>320
α*x + β + cos(x) = 0 α=tanθ β=-pi*tanθ+tanθasin(tanθ) + cos(asin(tanθ))
| - 底辺私立医大を卒業した医者って頭悪いよね? Part17
322 :卵の名無しさん[sage]:2020/07/30(木) 21:35:55.63 ID:Pwc04S3w - α*x + β + cos(x) = 0
α=tanθ β=-pi*tanθ+tanθasin(tanθ) + cos(asin(tanθ))
|
|