6. A three-dimensional vector has the form: A = (x, y, z) can be represented as: given the vectors: Example:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

6. A three-dimensional vector has the form:

A = (x, y, z)

can be represented as:

given the vectors:

Example:

Their sum is:
Example:

struct VECTOR { double x; double y; double z; };

A = ( a, b, c ) (5, 6, 2)

and

B = ( d, e, f ) (3, 1,9)

A + B = ( a + d, b + e, c + f ) (5 + 3, 6 + 1, 2 + 9)

= (8, 7,11)
A B = a x d + b x e + c x f

Their scalar product is:
(result is a scalar) example: 5 x 3 + 6 x 1 + 2 x 9 = 39

Write the complete definition code for the functions:

a. calc_sum computes and returns the sum of two vectors

b. scalar_prod computes and returns the scalar product of two vectors

6. A three-dimensional vector has the form: A= (x, y, z)
can be represented as:
struct VECTOR {
double x;
double y;
double
Z;
};
given the vectors:
A = (a, b, c)
and
(d, e, f )
B =
Example:
(5, 6, 2)
(3, 1,9)
Their sum is:
A +B =
(а + d, b + е, с + f)
Example:
(5 +3, 6 + 1, 2 +9)
= (8, 7,11)
||
Their scalar product is:
АВ 3 а хd +bxе+сxf
(result is a scalar)
example:
5 х3 +6х 1 + 2 х 9 %3D 39
Write the complete definition code for the functions:
calc _sum
computes and returns the sum of two vectors
а.
b. scalar_prod
computes and returns the scalar product of two vectors
Transcribed Image Text:6. A three-dimensional vector has the form: A= (x, y, z) can be represented as: struct VECTOR { double x; double y; double Z; }; given the vectors: A = (a, b, c) and (d, e, f ) B = Example: (5, 6, 2) (3, 1,9) Their sum is: A +B = (а + d, b + е, с + f) Example: (5 +3, 6 + 1, 2 +9) = (8, 7,11) || Their scalar product is: АВ 3 а хd +bxе+сxf (result is a scalar) example: 5 х3 +6х 1 + 2 х 9 %3D 39 Write the complete definition code for the functions: calc _sum computes and returns the sum of two vectors а. b. scalar_prod computes and returns the scalar product of two vectors
Expert Solution
Note:

As no programming language is mentioned, it is solved using basic C++

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education