Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Background A vector is a mathematical entity that has direction and magnitude. A

ID: 3737945 • Letter: B

Question

Background A vector is a mathematical entity that has direction and magnitude. A two-dimensional vector can be represented by a pair V -(a, b) of real numbers where a and b are the x- and y-coordinates of V. Given a real number r and two vectors Vi -(ai,bi) and V2 -(a2, b2), the magnitude of Vi is the real number Vi?V(al )2 + (bl )2, the scalar multiple of r and Vi is the vector r* Vi- (r*ai,r * bi), and the sum of Vi and V2 is the vector Vi + V2 - (ai + a2, bi + b2). If ri and r2 are real numbers, the linear combination of Vi, V2, , and r2 is the vector (r * Vi) + (r2 * V2). Overview The purpose of this assignment is to create a class in Python whose instances are two-dimensional vectors. Design, implement, and test a program that satisfies the requirements below.

Explanation / Answer

Here is python program with with above specification

Output:

v2.magnitude(): 5.0
v.scalarMultiply(5): 5 10
v.add(v2): 4 6
Linear combination : 11 16