Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168728
Image: ubuntu2004
a=vector([1,0,5]);a #initialize vector in R^3
(1, 0, 5)
b=vector([-2,1,0]);b #initialize vector in R^3
(-2, 1, 0)
c=a.cross_product(b);c #find vector cross product
(-5, -10, 1)
area1=c.norm();area1 #magnitude of axb is area of parallelogram described by a and b
3*sqrt(14)
area1.n(digits=10) #magnitude of axb is area of parallelogram described by a and b
11.22497216
area2=abs(c);area2 #magnitude of axb is area of parallelogram described by a and b
3*sqrt(14)
area2.n(digits=100) #magnitude of axb is area of parallelogram described by a and b
11.22497216032182415675124619694964790526805942333618083891123640196010546892081708393042968558313871
theta1=asin(area1/norm(a)/norm(b));theta1.n() #find angle between a and b a la torque
1.39447248797915
theta2=theta1*180/pi;theta2.n() #find angle between a and b a la torque
79.8973882083124
(a.plot(rgbcolor='red')+b.plot(rgbcolor='blue')+c.plot(rgbcolor='green')).show(aspect_ratio=1) #c is orthogonal to a and b
d=a.dot_product(b);d #scalar product
-2
theta3=acos(d/norm(a)/norm(b));theta3.n() #find angle between a and b in the parallelogram
1.74712016561065
theta4=theta3*180/pi;theta4.n() #find angle between a and b in the parallelogram
100.102611791688
e=vector([1,1,1]);e #initialize another vector in R^3
(1, 1, 1)
vol=abs(e.dot_product(c));vol #find volume of parallelepiped described by a, b and e
14
f=2*a;f #dilate a (multiply by scalar)
(2, 0, 10)
g=-3*b;g #dilated b (multiply by scalar)
(6, -3, 0)