# 미분적분학실습2-Week-3

## 1293 days ago by jhlee2chn

a = vector([1, 3, 4]) b = vector([2, 7, -5]) print b.cross_product(a)
 (43, -13, -1) (43, -13, -1)
a = vector([1, 2, -2]) b = vector([3, 0, 1]) print a.inner_product(a.cross_product(b)) print b.inner_product(a.cross_product(b))
 0 0 0 0
P = vector([1, 4, 6]) Q = vector([-2, 5, -1]) R = vector([1, -1, 1]) a = Q - P b = R - P u = a.cross_product(b) print u / u.norm()
 (-4/41*sqrt(82), -3/82*sqrt(82), 3/82*sqrt(82)) (-4/41*sqrt(82), -3/82*sqrt(82), 3/82*sqrt(82))
P = vector([1, 4, 6]) Q = vector([-2, 5, -1]) R = vector([1, -1, 1]) a = Q - P b = R - P show((1/2)*(a.cross_product(b)).norm())
 \newcommand{\Bold}[1]{\mathbf{#1}}\frac{5}{2} \, \sqrt{82}
a = vector([1, 4, -7]) b = vector([2, -1, 4]) c = vector([0, -9, 18]) print a.inner_product(b.cross_product(c))
 0 0
var('a, b, c') v = vector([a, b, c]) p = vector([1, 2, 1]) q = vector([3, 1, -5]) pv = p.cross_product(v) solve([pv[0] == q[0], pv[1] == q[1], pv[2] == q[2]], a, b, c)
 [[a == r2 + 1, b == 2*r2 - 3, c == r2]] [[a == r2 + 1, b == 2*r2 - 3, c == r2]]
w = vector([1, -3, 0]) p.cross_product(w) == q
 True True
range(0,3)
 [0, 1, 2] [0, 1, 2]
t = var('t') r0 = vector([5, 1, 3]) v = vector([1, 4, -2]) r = r0 + t*v print r
 (t + 5, 4*t + 1, -2*t + 3) (t + 5, 4*t + 1, -2*t + 3)
t = var('t') A = vector([2, 4, -3]) B = vector([3, -1, 1]) r0 = A v = B-A r = r0 + t*v print r
 (t + 2, -5*t + 4, 4*t - 3) (t + 2, -5*t + 4, 4*t - 3)
var('t, s') L1 = parametric_plot3d((1 + t, -2+3*t, 4 - t), (t, -50, 50), color="green") L2 = parametric_plot3d((2*s, 3 + s, -3 + 4*s), (s, -50, 50), color="red") L1 + L2
 Sleeping...
var('t, s') solve([1 + t == 2*s, -2 + 3*t == 3+s], t, s)
 [[t == (11/5), s == (8/5)]] [[t == (11/5), s == (8/5)]]
t = 11/5 s = 8/5 bool(4 - t == -3 + 4*s)
 False False
u = vector([3, 2, -1]) Q = vector([2, 1, -1]) P = vector([0, 1, -5]) PQ= Q-P (PQ.cross_product(u)).norm() / u.norm()
 1/7*sqrt(69)*sqrt(14) 1/7*sqrt(69)*sqrt(14)
var('x, y, z') p = vector([2, 4, -1]) n = vector([2, 3, 4]) q = vector([x, y, z]) n.inner_product (q - p) == 0
 2*x + 3*y + 4*z - 12 == 0 2*x + 3*y + 4*z - 12 == 0
implicit_plot3d(2*x + 3*y + 4*z - 12 == 0, (x, -3, 3), (y, -3, 3), (z, -3, 3))
 Sleeping...
solve(2*x + 3*y + 4*z - 12 == 0, z)
 [z == -1/2*x - 3/4*y + 3] [z == -1/2*x - 3/4*y + 3]
var('x, y, z') P = vector([1, 3, 2]) Q = vector([3, -1, 6]) R = vector([5, 2, 0]) T = vector([x, y, z]) n = (Q - P).cross_product(R - Q) n.inner_product (T - P) == 0
 12*x + 20*y + 14*z - 100 == 0 12*x + 20*y + 14*z - 100 == 0
var('x, y, z') n1 = vector([1, 1, 1]) n2 = vector([1, -2, 3]) ang_rad = arccos((n1.inner_product(n2))/(n1.norm()*n2.norm())).n(digits=5) print ang_rad
 1.2571 1.2571
n1.inner_product(n2)
 2 2
solve([x + y + z == 1, x - 2*y + 3*z == 1], x, y, z)
 [[x == -5/3*r3 + 1, y == 2/3*r3, z == r3]] [[x == -5/3*r3 + 1, y == 2/3*r3, z == r3]]
n1 = vector([1, 1, 1]) n2 = vector([1, -2, 3]) n1.cross_product(n2)
 (5, -2, -3) (5, -2, -3)
P = vector([1/2, 0, 0]) n = vector([5, 1, -1]) d = -1 D = abs(n.inner_product(P) + d) / n.norm() print D
 1/6*sqrt(3) 1/6*sqrt(3)
u1 = vector([1, 3, -1]) u2 = vector([2, 1, 4]) P = vector([1, -2, 4]) Q = vector([0, 3, -3]) n = u1.cross_product(u2) T = vector([x, y, z]) n.inner_product (T - Q) == 0
 13*x - 6*y - 5*z + 3 == 0 13*x - 6*y - 5*z + 3 == 0
d = 3 D = abs(n.inner_product(P) + d) / n.norm() print D
 4/115*sqrt(230) 4/115*sqrt(230)