TroglodyteDerivations commited on
Commit
6803e5f
1 Parent(s): c415270

Updated lines 18, 23 , 24 with: v3_text = f'The new vector 3 produced = vector 1: {self.v1} + vector 2: {self.v2} = {v3}’, plt.plot([0, self.v1[0]], [0, self.v1[1]], 'b', label='v1’) , plt.plot([0, self.v2[0]], [0, self.v2[1]], 'r', label='v2')

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -14,13 +14,14 @@ class Vector_Addition:
14
  return problem_add_prompt
15
 
16
  def vector_add(self):
17
- v3 = print(f'The new vector 3 produced = vector 1: {self.v1} + vector 2: {self.v2} =', self.v1+self.v2)
18
- return v3
 
19
 
20
  def plot_vector_add(self):
21
  plt.figure(figsize=(10,5))
22
  plt.plot([0, self.v1[0]], [0, self.v1[1]], 'b', label='v1')
23
- plt.plot([0, self.v2[0]+self.v1[0]], [0, self.v2[1]+self.v1[1]], 'r', label='v2')
24
  plt.plot([0, self.v1[0]+ self.v2[0]], [0, self.v1[1]+ self.v2[1]], 'k', label='v1+v2')
25
  plt.xlabel('X')
26
  plt.ylabel('Y')
 
14
  return problem_add_prompt
15
 
16
  def vector_add(self):
17
+ v3 = self.v1 + self.v2
18
+ v3_text = f'The new vector 3 produced = vector 1: {self.v1} + vector 2: {self.v2} = {v3}'
19
+ return v3_text
20
 
21
  def plot_vector_add(self):
22
  plt.figure(figsize=(10,5))
23
  plt.plot([0, self.v1[0]], [0, self.v1[1]], 'b', label='v1')
24
+ plt.plot([0, self.v2[0]], [0, self.v2[1]], 'r', label='v2')
25
  plt.plot([0, self.v1[0]+ self.v2[0]], [0, self.v1[1]+ self.v2[1]], 'k', label='v1+v2')
26
  plt.xlabel('X')
27
  plt.ylabel('Y')