Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Vector/11l/vector.11l
Normal file
26
Task/Vector/11l/vector.11l
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
T Vector
|
||||
Float x, y
|
||||
|
||||
F (x, y)
|
||||
.x = x
|
||||
.y = y
|
||||
|
||||
F +(vector)
|
||||
R Vector(.x + vector.x, .y + vector.y)
|
||||
|
||||
F -(vector)
|
||||
R Vector(.x - vector.x, .y - vector.y)
|
||||
|
||||
F *(mult)
|
||||
R Vector(.x * mult, .y * mult)
|
||||
|
||||
F /(denom)
|
||||
R Vector(.x / denom, .y / denom)
|
||||
|
||||
F String()
|
||||
R ‘(#., #.)’.format(.x, .y)
|
||||
|
||||
print(Vector(5, 7) + Vector(2, 3))
|
||||
print(Vector(5, 7) - Vector(2, 3))
|
||||
print(Vector(5, 7) * 11)
|
||||
print(Vector(5, 7) / 2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue