Advertisement
7XP

Untitled

7XP
Feb 12th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. a = list(map(float, input().split()))
  2. x1 = a[0]
  3. y1 = a[1]
  4. x2 = a[2]
  5. y2 = a[3]
  6. x3 = a[4]
  7. y3 = a[5]
  8.  
  9.  
  10.  
  11. class Vector:
  12. def __init__(self, x, y):
  13. self.x = x
  14. self.y = y
  15. def __mul__(left,right):
  16. return (left.x * right.y- left.y*right.x)
  17.  
  18. a=Vector(x2-x1,y2-y1)
  19. b=Vector(x3-x1,y3-y1)
  20.  
  21.  
  22. print(abs (a * b / 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement