# グラフの大きさを指定するおまじない
options(repr.plot.width=4, repr.plot.height=4)
par(mar = c(1, 1, 1, 1), xpd = T)
余弦定理を忘れているのでピタゴラスの定理から計算してみる。 $$ \begin{align} CD^ 2 = BC^2 - BD^2 &= AC^2 - AD^2 \\ BC^2 - BC^2(\cos B)^2 &= AC ^ 2 - (AB - BC\cos B)^2 = AC^2 - AB^2 + 2AB\cdot BC\cos B -BC^2(\cos B)^2 \\ BC^2 &= 9 - 4 + 2 \cdot 2 \cdot BC\frac{1}{2} \\ BC^2 -2BC - 5 &= 0 \\ BC &= 1\pm\sqrt{6} \\ \end{align} $$ $BC > 0$より$BC=\sqrt{6}+1$
A <- c(5, 0)
B <- c(0, 0)
C <- c(4, 3)
D <- c(C[1], 0)
plot(0, type = 'n', xlim = c(0, 5), ylim = c(0,5), axes = F, xlab = "", ylab = "")
polygon(rbind(A, B, C))
polygon(rbind(C,D))
text(rbind(A, B, C, D), c("A", "B", "C", "D"), pos = c(4, 2, 3, 1), xpd = T)
円周角の定理から$\angle COA = \angle B \times 2 = 120 ^{\circ}$
$OC = OA$なので$\triangle OAC$は二等辺三角形
$AC = 3$から$OA = 3 \div 2 \div \sqrt{3} \times 2 = \sqrt{3}$
A <- c(2, 0)
B <- c(0, 0)
C <- c(cos(pi/3), sin(pi/3)) * (sqrt(6) + 1)
# 外接円の中心 0 < x < 2, 0 < y < C を探す
x <- seq(0, 2, length = 100)
y <- seq(0, C[2], length = 100)
xy <- as.matrix(expand.grid(x, y))
# (x,y) とA,B,Cの距離の分散
rv <- apply(xy, 1, function (o){
var(apply(rbind(A, B, C), 1, function (a){
sqrt(sum((o - a)^2))
}))
})
# 分散が一番小さい = 距離が等しい = 中心
O <- xy[which(rv == min(rv)),]
r <- sqrt(sum((A - O)^2))
# 三角形を書く
plot(0, type = 'n', xlim = c(0, 3), ylim = c(0,3), xlab = "", ylab = "", axes = F)
polygon(rbind(A, B, C))
text(rbind(A, B, C), c("A", "B", "C"), pos = c(4, 2, 3), xpd = T)
# 外接円を描く
theta <- seq(-pi, pi, length = 100)
polygon(cos(theta) * r + O[1], sin(theta) * r + O[2], xpd = T)
points(O[1], O[2], pch = 19)
text(O[1], O[2], 'O', pos = 3)
polygon(rbind(A, O, C), lty = 'dashed')
各辺(a, b, c)と内接円の接点をHa, Hb, Hcとすると、BC = BHa + CHa, BHa = BHcとなる $$ \begin{align} AC = AHb + CHb = (BA - BHc) + (BC - BHa) = 2 + \sqrt{6} + 1 - 2BHa &= 3 \\ BHa &= \frac{\sqrt{6}}{2} \\ \end{align} \\ 半径 = OHc = BHa\tan 30^{\circ} = \frac{\sqrt{6}}{2} \div \sqrt{3} = \frac{\sqrt{2}}{2} $$
# 角Bの2等分線上の点
x <- seq(0, 2, length = 100)
y <- x * tan(pi / 6)
# 角Aの2等分線上の点との距離がもっとも近い = 二等分線の交点
AC <- C - A
a <- atan(AC[2] / AC[1]) / 2 #角Aの二等分線の傾き
dy <- abs((x - A[1]) * a - y) # 二等分線間の距離
O <- cbind(x, y)[which(dy == min(dy)),]
r <- O[2]
# 三角形を書く
plot(0, type = 'n', xlim = c(0, 3), ylim = c(0,3), xlab = "", ylab = "", axes = F)
polygon(rbind(A, B, C))
text(rbind(A, B, C), c("A", "B", "C"), pos = c(4, 2, 3), xpd = T)
#text(rbind((A + B)/2, (B + C) / 2, (C + A) / 2), c("Ha", "Hb", "Hc"), pos = c(4, 2, 3))
# 内接円を描く
theta <- seq(-pi, pi, length = 100)
polygon(cos(theta) * r + O[1], sin(theta) * r + O[2], xpd = T)
points(O[1], O[2], pch = 19)
text(O[1], O[2], 'O', pos = 3)
curve(x * tan(pi / 6), from = 0, to = 2, add =T)
curve((x -2) * a, from = 0, to = 2, col = 'red', add =T)
# 内接円にみえない。何かが違うがわからない。give up
A <- c(0, 2)
B <- c(4, 2)
E <- c(0, 0)
F <- c(4, 0)
front <- rbind(A, B, F, E)
back <- front + rep(c(2, 2/3), each = 4)
plot(0, type = 'n', xlim = c(0, 6), ylim = c(0,4), xlab = "", ylab = "", axes = FALSE)
polygon(front)
text(front, c("A", "B", "F", "E"), pos = c(2, 4, 4, 2), xpd = T)
polygon(back)
text(back, c("D", "C", "G", "H"), pos = c(2, 4, 4, 2), xpd = T)
x <- apply(cbind(front, back), 1, function (ft){
segments(ft[1], ft[2], ft[3], ft[4])
})
segments(front[1,1], front[1,2], back[2,1], back[2,2], lwd = 2)
segments(front[3,1], front[3,2], back[2,1], back[2,2], lwd = 2)
segments(front[1,1], front[1,2], front[3,1], front[3,2], lwd = 2)
実数解が存在するためには$9-4a\geqq0 かつ 28-2a\geqq0$ よって$a\leqq\frac{9}{4} \cdots$ 条件1
下の図の青色の線が$y = x^2-x+a-2$で緑色の線が$y= 2x^2-4x+a-12$を示す。 青の放物線の軸は$x = -\frac{1}{2}$で、緑のほうは$x = 1$である。 青が0以上で、緑が0以下であるxの範囲は右側のほうが広い(つまりxが存在条件が広い)。 青放物線がx軸と交わるときのx座標が緑放物線とのものより小さければ条件を満たすことができる。よって次式が成り立つ。 $$ \begin{align} \frac{1+\sqrt{9-4a}}{2} &\leqq \frac{2+\sqrt{28-2a}}{2} \\ 1-2\sqrt{9-4a} + 9-4a &\leqq 28-2a \\ -\sqrt{9-4a} &\leqq 9+a \\ \sqrt{9-4a} &\geqq -(9+a) \\ \end{align} $$ $9+a > 0$のとき$a > -9$ かつ$9-4a > 0$ よって $ -9 < a < \frac{9}{4} \cdots$ 条件2
$9+a <0$のとき $$ \begin{align} 9-4a &> 81 +18a + a^2 \\ a^2 +22a + 72 &< 0 \\ -18 &< a < -4 \cdots 条件3 \\ \end{align} $$ 条件1-3を合わせると $ -18 < a < \frac{9}{4} $
curve(2*x^2-4*x-12, from = -4, to = 6, col = 'green', axes = FALSE, xlab = "", ylab = "")
curve(x^2-x-2, col = 'blue', add = T)
abline(h = 0)
abline(v = 0)
abline(v = 1/2, col = 'blue', lty = 'dashed')
abline(v = 1, col = 'green', lty = 'dashed')
表 | 得点 |
---|---|
0 | -14 |
1 | -11 |
2 | -8 |
3 | -5 |
4 | -2 |
5 | 1 |
6 | 4 |
7 | 7 |
7回表 + 6回表 = $ (\frac{1}{2})^7 + \frac{7}{128} = \frac{7}{128} = \frac{1}{16} $
3点以下 = $ 1 - (\frac{1}{16}) = \frac{15}{16} $
t <- (0:100) / 100
r <- 2
plot(r * cos(t * 2 * pi), r * sin(t * 2 * pi), type = 'l', xlab = 'x', ylab = 'y')
abline(h = 0); abline(v = 0);
theta <- asin(1/2)
x <- r * cos(theta); y <- r * sin(theta)
polygon(c(x, x, -x, -x), c(y, -y, -y , y))
segments(0, 0, x, y)
polygon(0.4 * cos(t * theta), 0.4 * sin(t * theta))
text(0.5 * cos(0.5 * theta / 2), 0.5 * sin(0.5 * theta / 2), labels = "θ", adj = c(1, 0))