Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions vectors/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ def dot(self, vector, theta=None):
is measured in degrees.
"""
if theta is not None:
return (self.magnitude() * vector.magnitude() *
math.degrees(math.cos(theta)))
return self.magnitude() * vector.magnitude() * math.cos(math.radians(theta))
return (reduce(lambda x, y: x + y,
[x * vector.to_list()[i] for i, x in enumerate(self.to_list())]))

Expand Down