Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include struct points { float a; float b; float c; }; int main() { float x,y,z; struct points p1; struct points p2; scanf(%f %f

image text in transcribed#includeimage text in transcribed #include struct points { float a; float b; float c; }; int main() { float x,y,z; struct points p1; struct points p2; scanf("%f %f %f",&p1.a,&p1.b,&p1.c); scanf("%f %f %f",&p2.a,&p2.b,&p2.c); printf("v1:( %.2f %.2f %.2f) ",p1.a,p1.b,p1.c); printf("v2:( %.2f %.2f %.2f) " ,p2.a,p2.b,p2.c); x=p1.a+p2.a; y=p1.b+p2.b; z= p1.c+p2.c; printf("v1+v2:( %.2f,%.2f,%.2f) ",x,y,z); x=p2.a-p1.a; y=p2.b-p1.b; z=p2.c-p1.c; printf("v2-v1:( %.2f,%.2f,%.2f) ",x,y,z); float n1=sqrt((p1.a*p1.a)+ (p1.b*p1.b)+ (p1.c*p1.c)); float n2=sqrt((p2.a*p2.a)+ (p2.b*p2.b)+ (p2.c*p2.c)); printf("norm(v1):%.2f ",n1); printf("norm(v2):%.2f ",n2); float d=sqrt(((p1.a-p2.a)*( p1.a-p2.a))+(( p1.b-p2.b)*( p1.b-p2.b))+(( p1.c-p2.c)*( p1.c-p2.c))); printf("dist(v1,v2):%.2f ",d); float p=(p1.a*p2.a)+(p1.b*p2.b)+(p1.c+p2.c); printf("prod(v1,v2):%.2f ",p); float pj1=(p1); float pj2=(p2); printf("proj(v1,v2):%.2f ",pj2); printf("proj(v2,v1):%.2f ",pj1); float a=(p/(n1*n2)); float fa=acos(a)*(1260/22); //float fa1=acos(fa); printf("angle(v2,v1):%.2f ",fa); return 0; }?

Compilation failed main.c: In function 'testPassed': main.c:33: 4: error: unknown type name 'vector' vector vec = initVect (10, 10, 10); Ayny w main.c:33:17: warning: implicit declaration of function initVect' [-Wir vector vec = initVect (10, 10, 10); main.c:34:11: error: request for member 'x' in something not a structure if (vec.x == 10 && vec.y == 10 && vec.z == 10) Compilation failed main.c:34:26: error: request for member 'y' in something not a structure if (vec.x == 10 && vec.y == 10 && vec.z == 10) main.c:34:41: error: request for member 'z' in something not a structure if (vec.x == 10 && vec.y == 10 && vec.z == 10) main.c:33:11: warning: variable 'vec' set but not used [-Wunused-but-sel vector vec = initVect (10, 10, 10); AN main.c: 40:1: warning: control reaches end of non-void function [-Wreturi

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

LO2 Explain the major laws governing employee compensation.

Answered: 1 week ago