input: other vector assumes: other vector has the same size returns a new vector that represents the differenz.
(self, other)
| 119 | return Vector(result) |
| 120 | |
| 121 | def __sub__(self, other): |
| 122 | """ |
| 123 | input: other vector |
| 124 | assumes: other vector has the same size |
| 125 | returns a new vector that represents the differenz. |
| 126 | """ |
| 127 | size = self.size() |
| 128 | result = [] |
| 129 | if size == other.size(): |
| 130 | for i in range(size): |
| 131 | result.append(self.__components[i] - other.component(i)) |
| 132 | else: # error case |
| 133 | raise Exception("must have the same size") |
| 134 | return Vector(result) |
| 135 | |
| 136 | def __mul__(self, other): |
| 137 | """ |