Hi all.
Would it be a good idea to have a polar coordinate class and derive from it spherical and cylindrical coordinate classes?
Or should I keep 3 separate classes?

Recommended Answers

All 2 Replies

  1. Is SphericalCoordinate a kind of PolarCoordinate? If not, it shouldn't be a subclass. EndOf.
  2. Are there situations where you will use or accept a PolarCoordinate without worrying about whether it's cylindrical or spherical? If so, the common superclass will be useful
  3. Is there a useful amount of implementation detail that's common to spherical and cylindrical? If so a superclass could be useful

As of your first question it made it very clear to me. I'll keep 3 separate classes.
Although a "component" of a spherical and cylindrical coordinate, could be considered a 2D polar coordinate, there is no real relation.
Thanks for helping clarify that. :)

commented: Is this really works? +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.