Question
(mathematical) In two dimensions, a vector is a pair of numbers representing directed arrows in a plane as shown by vectors V1 and V2 in
(mathematical) In two dimensions, a vector is a pair of numbers representing directed arrows in a plane as shown by vectors V1 and V2 in the figure below. Two-dimensional mathematical vectors can be written in the form (a,b), where a and b called the x and y componenets of the vector. For example, for the vectors in the Figure, V1 = (9,4) and V2=(3,5). For mathematical vectors, the following operations apply:
If V1 = (a,b) and V2=(c,d)
V1 + V2 = (a,b) + (c,d) = (a+c, b+d)
V1 - V2 = (a,b) - (c,d) = (a-c, b-d)
Using the information, write a C++ program that defines an array of two mathematical vector strutures; each structure consists of two double-precision components, a and b. Your program should permit a user to enter two vectors, call two functions that return the sum and difference of the entered vectors, and display the results calculated by these functions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started