Python vector2 - Programming On Unix

Users browsing this thread: 1 Guest(s)
vompatti
Long time nixers
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)
What's programmers favorite thing to do? DELETE CODE!
Git: https://github.com/vhakulinen
oh no you didnt
venam
Administrators
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.
vompatti
Long time nixers
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