![]() ![]() ![]() The class I've written so far is below and while it works as expected, my limited understanding of Python classes and the property function tells me there's a better way to do this. ![]() I want an instance of my class to do the following: > p = PositionVector() This class will be later be reused in other classes via composition. Updating one attribute automatically updates the others. I want an instance of the class to be able to store both the cartesian and polar coordinates of a position. I've written my first ever class for a position vector. However, I'm trying to change that and I see value in implementing OO when modelling the physical world. I have had little experience with OO programming, being a typical engineer I tend to hack together functional code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |