

# -*- coding: UTF-8 -*-
'''
Vector3 3D向量类
关于操作符重载 http://docs.python.org/reference/datamodel.html
'''
import math
class Vector3():
def __init__(self,x,y,z):
self.x = x
self.y = y
self.z = z
#置为零向量
def zero():
self.x = 0
self.y = 0
self.z = 0
#"=" 赋值不支持重载
#重载 "==" 操作符
def __eq__(self, other):
return self.x == other.x and self.y == other.y and self.z == other.z
#重载 "!=" 操作符
def __ne__(self, other):
return self.x != other.x or self.y != other.y or self.z != other.z
#重载一元 "-" 操作符