Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point3D:
- def __init__(self, x, y, z, r, phi, psi):
- self.x = x
- self.y = y
- self.z = z
- self.r = r
- self.phi = phi
- self.psi = psi
- @staticmethod
- def r_from_cartesian(x, y, z):
- pass
- @staticmethod
- def phi_from_cartesian(x, y, z):
- pass
- @staticmethod
- def psi_from_cartesian(x, y, z):
- pass
- @staticmethod
- def x_from_polar(r, phi, psi):
- pass
- @staticmethod
- def y_from_polar(r, phi, psi):
- pass
- @staticmethod
- def z_from_polar(r, phi, psi):
- pass
- @classmethod
- def from_cartesian(cls, x, y, z):
- r = cls.r_from_cartesian()
- phi = cls.phi_from_cartesian()
- psi = cls.psi_from_cartesian()
- return cls(x, y, z, r, phi, psi)
- @classmethod
- def from_polar(cls, r, phi, psi):
- x = cls.x_from_polar(r, phi, psi)
- y = cls.y_from_polar(r, phi, psi)
- z = cls.z_from_polar(r, phi, psi)
- return cls(x, y, z, r, phi, psi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement