#Name: Laraib Shaikh

#Student Number: 1205628

#mac id: shaikhl

#Lab Section: L09

#Lab: minor 06



#this assignment creates a class whose instances are two-dimentional vectors



class Vector():

    

    def __init__(self,a,b):

        self.a = a

        self.b = b

        

    def getA(self):

        return self.a



    def getB(self):

        return self.b

    

    def magnitude(self):

        mag = ((self.a)**2+(self.b)**2)**0.5

        return mag



    def scalarMultiply(self,s):

        scalar = s* self.a, s*self.b

        return scalar

    

    def add(self,v):

        x,y = self.a + v.getA(),  self.b + v.getB()

        B=Vector(x,y)

        return B

    

    def linearCombo(self,v,a,b):

        comboV = Vector (a*self.a + b*v.a, a*self.b + b*v.b)

        return comboV

        



"""

Question:



x,y = self.a - v.getA(),  self.b - v.getB()

By using the above formula we can find the differece



testcases:

V=Vector(4,3)

v1=Vector(3,3)



1)input               v2=V.linearCombo(v1,2,3)

  expected output     Vector(17,15)



2)input               v2=V.linearCombo(v1,0,0)

  expected output     Vector(17,15)



3)input               v2=V.linearCombo(v1,-3,-5)

  expected output     Vector(-27,-24)

"""

        

