/tutorial/triangle/version2/point.e

http://github.com/tybor/Liberty · Specman e · 32 lines · 21 code · 7 blank · 4 comment · 0 complexity · 8aad1023395e86cc042c0b448cca0f00 MD5 · raw file

  1. class POINT
  2. -- Description of POINTs objects.
  3. creation {ANY}
  4. make
  5. feature {ANY}
  6. x: REAL
  7. -- The `x' coordinate.
  8. y: REAL
  9. -- The `y' coordinate.
  10. rho: REAL is
  11. do
  12. Result := x.sin
  13. end
  14. make (vx, vy: REAL) is
  15. do
  16. x := vx
  17. y := vy
  18. end
  19. translate (dx, dy: REAL) is
  20. -- To translate the `Current' POINT.
  21. do
  22. x := x + dx
  23. y := y + dy
  24. end
  25. end -- class POINT