Question: EXERCISE4 (4 points) Difficulty: Moderate Applications of the Dot and Cross Products In this exercise, you will consider geometrical applications of the dot and cross

EXERCISE4 (4 points) Difficulty: Moderate Applications of the Dot and Cross Products In this exercise, you will consider geometrical applications of the dot and cross products.

**Create a function in MATLAB function [] = crossdot(a,b,c) which takes as inputs nonzero vectors a, b, and c in .

**First, you code has to determine if the vectors a and b are parallel. If they are parallel, output the message a and b are parallel and parallelogram cannot be built on them and terminate the program. If they are not parallel, the code will continue with: (1) calculating the area, A, of the parallelogram built on these vectors by using the cross product; (2) calculating the distance, d, from the line spanned by a to the point in , whose position vector is b; (3) the angle, ( ), between the lines spanned by the vectors a and b; (4) the orthogonal projection, p, of the vector b onto the vector a.

**Next, your program will check if the vectors a, b, and c are coplanar, that is, lie in the same plane. If they are coplanar, the program terminates with the message 'a,b,c are coplanar and parallelepiped cannot be built on them'. If they are not coplanar, you should find: (1) the volume, V, of the parallelepiped built on a, b, and c; (2) the distance, D, from the point in with the position vector c to the plane spanned by the vectors a and b. You can use built-in matlab functions in your code such as rank, cross, dot, norm, abs, acos.

**Type the function crossdot in your diary file.

**Run the function crossdot(a,b,c) on the following (row) vectors:

(a) a = [1,2,3], b = a, c = randi(10,1,3)

(b) a = [1,2,0], b = [2,0,1], c = -b

(c) E=eye(3); a = E(1,:), b = 2*E(2,:), c = 3*E(3,:)

(d) a= [1,0,-3], b=[-2,1,-1], c = ones(1,3)

(e) a= [2,0,-3], b=[-2,1,-1], c = ones(1,3)

Need help writing the code in MATLAB as a function!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!