(self, v)
| 55 | return math.sqrt(math.pow(self.x, 2) + math.pow(self.y, 2)) |
| 56 | |
| 57 | def cos(self, v): |
| 58 | dot = self.x * v.x + self.y * v.y |
| 59 | cos = dot / (math.sqrt(math.pow(self.x, 2) + math.pow(self.y, 2)) * v.length()) |
| 60 | |
| 61 | if cos > 1: |
| 62 | cos = 1 |
| 63 | if cos < -1: |
| 64 | cos = -1 |
| 65 | return 180 / math.pi * math.acos(cos) |
| 66 | |
| 67 | def k(self): |
| 68 | k = (self.y2 - self.y1) / (self.x2 - self.x1) |
no test coverage detected