Question: C language please!! C language please, and thank you!! 13.24 Structs - Ex1 Requirements (Read Carefully) Define a structure data type that holds three double
C language please!!
C language please, and thank you!!
13.24 Structs - Ex1 Requirements (Read Carefully) Define a structure data type that holds three double data members (xyz). Define an alias for this data type named vector (using typedef). Create a function named initVect that receives three double numbers and returns vector structure initialized with the values passed to the function where the first parameter is the value for data member x and the last one for data member z. Create a function named invVect that takes a vector structure and returns the inverse of the vector (negative value of each data member: xyz) Create a function named normVect that takes a vector structure and returns the Euclidean norm of the vector defined as: 2 Create a function named addVect that takes two vector structures and returns a vector structure with the sum of both vectors passed to the function. Create a function named distVect that takes two vector structures and returns the Euclidean distance between the two vectors defined as: distance =V (x2-x1)2 + (y2-yl)2 + (e2-1)2 Create a function named prodVect that takes two vector structures and returns the scalar product of both vectors defined as: Create a function named projVect that takes two vector structures and returns the scalar projection of the first vector onto the second vector defined below. If the norm of v2 is zero then return 0. vl v2 Iv2l proj =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
