Writing a matrix and vector class, if done properly, is something you should onl
ID: 3559610 • Letter: W
Question
Writing a matrix and vector class, if done properly, is something you should only need to do a handful of times in your programming career. Given that these classes are essential to computer graphics, we are going to work on our own versions now. Using Microsoft Visual Studio 2010 and C++. Please write a program that does the following: Runs on the console Allows the user to perform the following actions: Addition of two vectors Subtraction of two vectors The dot product of two vectors o The cross product of two vectors o Multiply a vector by a matrix Multiply a matrix by a matrix Accepts input from the user of the following format: For vectors Ask for three numbers, separated by commas For matrices For each row Ask for four numbers, separated by commas Outputs the result of the calculation in a human-readable formatExplanation / Answer
1) Add 2 vector in C++
Add 2 vector in VB
Public Shared Operator +(
_ vector1 As Vector,
_ vector2 As Vector _
) As Vector
vectorResult = vector1 + vector2
Return vectorResult
End Function
2) Subtract two vectors c++
Subtract two vectors in VB
Dim vectorResult As Vector = Vector.Subtract(vector1, vector2)
Return vectorResult
End Function
3) Dot product of Vector in C++
Dot product of Vector in VB
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.