MCPcopy Create free account
hub / github.com/ActiveState/code / project

Method project

recipes/Python/578006_vector/recipe-578006.py:430–433  ·  view source on GitHub ↗
(self, vec)

Source from the content-addressed store, hash-verified

428 # Standard Vector Operations
429
430 def project(self, vec):
431 x, y = vec.x, vec.y
432 temp = (self.x * x + self.y * y) / (x * x + y * y)
433 return Vector2(x * temp, y * temp)
434
435 def rotate(self, vec):
436 x1, y1, x2, y2 = self.x, self.y, vec.x, vec.y

Callers 1

recipe-577799.pyFile · 0.45

Calls 1

Vector2Class · 0.70

Tested by

no test coverage detected