quiz 12.4,12.5

124 days ago by nathantoddstone

var('x,y,z') 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(x, y, z\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(x, y, z\right)
r0 = x,y,z r1 = -6,2,2 r2 = -4,-6,-2 r3 = 6,5,-2 r0,r1,r2,r3 = [vector(v) for v in r0,r1,r2,r3] e1 = r2-r1 e2 = r3-r1 n = e1.cross_product(e2) plane = n.dot_product(r0-r1) plane 
       
\newcommand{\Bold}[1]{\mathbf{#1}}44 \, x - 40 \, y + 102 \, z + 140
\newcommand{\Bold}[1]{\mathbf{#1}}44 \, x - 40 \, y + 102 \, z + 140
solve(plane, z) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[z = -\frac{22}{51} \, x + \frac{20}{51} \, y - \frac{70}{51}\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[z = -\frac{22}{51} \, x + \frac{20}{51} \, y - \frac{70}{51}\right]
r = 10 plane = plot3d(-22/51*x + 20/51*y - 70/51,(x,-r,r),(y,-r,r)) p1,p2,p3 = [point3d(v, size=40) for v in r1,r2,r3] plane+p1+p2+p3 
       
var('t') def r(t): return 4-2*t,3-2*t,-8-6*t r1 = vector(r(0)) r2 = vector(r(2)) r3 = vector([8,-8,6]) def line(r1,r2): return r1 + t*(r2-r1) P1=point3d(r3,size=30) L1=parametric_plot3d(r(t),(t,0,2),thickness=10) L2=parametric_plot3d(line(r1,r3),(t,0,1),thickness=10) L3=parametric_plot3d(line(r2,r3),(t,0,1),thickness=10) L1+L2+L3+P1 
       
v1 = r3-r1 v2 = r2-r1 n = v1.cross_product(v2) r0 = vector([x,y,z]) plane = n.dot_product(r0-r1) plane, solve(plane,z) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(188 \, x - 8 \, y - 60 \, z - 1208, \left[z = \frac{47}{15} \, x - \frac{2}{15} \, y - \frac{302}{15}\right]\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(188 \, x - 8 \, y - 60 \, z - 1208, \left[z = \frac{47}{15} \, x - \frac{2}{15} \, y - \frac{302}{15}\right]\right)
plot3d(47/15*x - 2/15*y - 302/15,(x,0,10),(y,-5,5))+L1+L2+L3+P1 
       
u=vector([1,-7,-6]) v=vector([-9,-4,6]) u.cross_product(v) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-66,\,48,\,-67\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-66,\,48,\,-67\right)
a=3,2,-1 b=0,1,2 c=2,3,1 a,b,c = [vector(m) for m in a,b,c] a.dot_product(b.cross_product(c)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-5
\newcommand{\Bold}[1]{\mathbf{#1}}-5