School/.venv/lib/python3.9/site-packages/mathprolib/linear_algebra.py
Kristofers Solo 1e065cc4b2 Updated .venv
2021-11-22 17:11:45 +02:00

23 lines
697 B
Python

VectorError = RuntimeError
class LinearTransformations2D(object):
def __init__(self,ix,iy,jx,jy):
self.ix,self.jx,self.iy,self.jy = ix,jx,iy,jy
class Vector2D(object):
def __init__(self,x,y):
self.x = x
self.y = y
def __mul__(self, other, mul_type="Dot"):
if isinstance(other,LinearTransformations2D):
return
def __repr__(self):
return f"{self.x}\n{' '*(len(str(max(self.x, self.y))))}\n{self.y}"
def __add__(self, other):
if isinstance(other,Vector2D):
return Vector2D(self.x + other.x,self.y + other.y)
else:
raise VectorError
print(Vector2D(1,2)+Vector2D(3,4))