Question: C$210-Machine Problem 6 Vector Library 20 Points March 22,2018 Your task is to implement a brary for handling 3-d vector arithmetic. For this project, you

 C$210-Machine Problem 6 Vector Library 20 Points March 22,2018 Your task

C$210-Machine Problem 6 Vector Library 20 Points March 22,2018 Your task is to implement a brary for handling 3-d vector arithmetic. For this project, you will not submit a main.c fle, you will simply submit the vector c and vecter files in a single aip my driver program to test your implementation le. I will nun Specifications The type of vectors should be called vector t It should have three doubleprecison components named x, y, and . You must provide a function vector t make, vector (double s. double . double a) that takes three double arguments representing the components of a vector and returns a vector.. You must provide a function vold vec2a(vector,t v, char reault)that puts a string represen- tation of x into the string reault. The format should be: a.. with no spaces and three places past the decimal point. (e.g. . You must provide functions for the following arithmetic operations: vec add that takes two vectors and returns their sum. vec aub that takes two vectors and returns their difference. - vec,scale that takes a vector and a double and returns the vector multiplied by the double. - vec_dot that takes two vectors and returns a double which is their dot product - vec_cross that takes two vectors and returns a vector that is their cross product vec_aagnitude that takes a vector and returns its magnitude (as a double). -vec unitvector that takes a vector and returns a unit vector with the same direction as argu ment. - vec unitnormal that takes two vectors and returns a unit vector that is orthogonal to both of them. (Hint: The cross product of two vectors is orthogonal to both of them) You may use the following formulae: sprintf (str ) %d

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!