def __init__(self, p=None, v=None, p0=None, p1=None):
"""
Init by either
p: Vector or tuple origin
v: Vector or tuple size and direction
or
p0: Vector or tuple 1 point location
p1: Vector or tuple 2 point location
Will convert any into Vector 2d
both optionnals
"""
Projection.__init__(self)
if p is not None and v is not None:
self.p = Vector(p).to_2d()
self.v = Vector(v).to_2d()
elif p0 is not None and p1 is not None:
self.p = Vector(p0).to_2d()
self.v = Vector(p1).to_2d() - self.p
else:
self.p = Vector((0, 0))
self.v = Vector((0, 0))
评论列表
文章目录