nixers
Python vector2 - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Development & Graphics (https://nixers.net/Forum-Development-Graphics)
+--- Forum: Programming On Unix (https://nixers.net/Forum-Programming-On-Unix)
+--- Thread: Python vector2 (/Thread-Python-vector2)


Python vector2 - vompatti - 04-01-2013

Dunno if python has any vector libarys but here is one simple which I made.

http://pastebin.com/NX8bXBfS

Hope someone else has some use for this, excpet me :)

EDIT: frogot one test statement to line 33 :S (print x, y)


RE: Python vector2 - venam - 04-01-2013

return "".join([str(self.x), ", ", str(self.y)])
is also equivalent to [str(self.x)+","+str(self.y)] . No use for the join I believe.
Also, manipulating arrays,tupple, dictionaries is easy in python so there's no real need for this kind of module.
Anyway, if you are used to manipulate them this way then it's ok.


RE: Python vector2 - vompatti - 04-01-2013

Got bored @school so this was the result of it :D

And I used to code in C# and .Net libarys has vectors so I though that it would be same just to try make one my self, but yeah.. With some upgrades, this might make my life easyer some day :3