Exemple #1
0
    def order(self, other):
        min_x, max_x = mhat.order(self.get_x(), other.get_x())
        min_y, max_y = mhat.order(self.get_y(), other.get_y())
        min_z, max_z = mhat.order(self.get_z(), other.get_z())

        return mhat.Vector3(min_x, min_y,
                            min_z), mhat.Vector3(max_x, max_y, max_z)
Exemple #2
0
    def __div__(self, scalar):
        if isinstance(scalar, (int, float, long)):
            return mhat.Vector3(self.get_x() / scalar,
                                self.get_y() / scalar,
                                self.get_z() / scalar)

        return NotImplemented
Exemple #3
0
 def __sub__(self, other):
     return mhat.Vector3(self.get_x() - other.get_x(),
                         self.get_y() - other.get_y(),
                         self.get_z() - other.get_z())
Exemple #4
0
 def __add__(self, other):
     return mhat.Vector3(self.get_x() + other.get_x(),
                         self.get_y() + other.get_y(),
                         self.get_z() + other.get_z())
Exemple #5
0
 def get_with_z(self, z):
     return mhat.Vector3(self.get_x(), self.get_y(), z)
Exemple #6
0
 def get_with_y(self, y):
     return mhat.Vector3(self.get_x(), y, self.get_z())
Exemple #7
0
 def get_with_x(self, x):
     return mhat.Vector3(x, self.get_y(), self.get_z())