euclid.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:dxf2gcode 作者: cnc-club 项目源码 文件源码
def __mul__(self, other):
        if isinstance(other, Vector3):
            # TODO component-wise mul/div in-place and on Vector2; docs.
            if self.__class__ is Point3 or other.__class__ is Point3:
                _class = Point3
            else:
                _class = Vector3
            return _class(self.x * other.x,
                          self.y * other.y,
                          self.z * other.z)
        else: 
            assert type(other) in scalar_types
            return Vector3(self.x * other,
                           self.y * other,
                           self.z * other)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号