summaryrefslogtreecommitdiff
path: root/pos.lua
diff options
context:
space:
mode:
Diffstat (limited to 'pos.lua')
-rw-r--r--pos.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/pos.lua b/pos.lua
index 605ecbd..149783e 100644
--- a/pos.lua
+++ b/pos.lua
@@ -36,6 +36,7 @@ function Pos.lensq(self) return self.x^2 + self.y^2 end
function Pos.len(self) return math.sqrt(self:lensq()) end
function Pos.norm(self) return self/self:len() end
function Pos.dot(self,other) return self.x*other.x+self.y*other.y end
+function Pos.vals(self) return self.x, self.y end
function Pos.__tostring(self)
return string.format("(%.2f,%.2f)",self.x,self.y)
end