Class: Archimate::Svg::Point
- Inherits:
-
Struct
- Object
- Struct
- Archimate::Svg::Point
- Defined in:
- lib/archimate/svg/point.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
5 6 7 |
# File 'lib/archimate/svg/point.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y
5 6 7 |
# File 'lib/archimate/svg/point.rb', line 5 def y @y end |
Instance Method Details
#-(other) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/archimate/svg/point.rb', line 6 def -(other) Math.sqrt( ((other.x - x)**2) + ((other.y - y)**2) ) end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/archimate/svg/point.rb', line 13 def to_s [x, y].map(&:to_s).join(" ") end |