Skip to content
Snippets Groups Projects
Commit e5b67968 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Add left multiplication by a float

parent da989898
Branches
Tags
No related merge requests found
......@@ -93,6 +93,12 @@ class R3 (object):
self.checkOther(other, "*")
return reduce(lambda x, y: x + y[0]*y[1], zip(self, other),0.)
def __rmul__ (self, number):
"""
Operator * by a float
"""
return R3(tuple(map(lambda x: number * x, self)))
def __str__(self):
"""
Output as a string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment