Module: Wicket::Cartesian
- Included in:
- Coordinate, Subpoint
- Defined in:
- lib/wicket/cartesian.rb
Instance Method Summary collapse
Instance Method Details
#distance_to(remote) ⇒ Object
4 5 6 |
# File 'lib/wicket/cartesian.rb', line 4 def distance_to(remote) Math.sqrt((remote.x - x) ** 2 + (remote.y - y) ** 2) end |
#to_svg(o = {}) ⇒ Object
12 13 14 |
# File 'lib/wicket/cartesian.rb', line 12 def to_svg(o={}) [x,y].map{|a| format(a,o)}.join(",") end |
#to_wkt(o = {}) ⇒ Object
8 9 10 |
# File 'lib/wicket/cartesian.rb', line 8 def to_wkt(o={}) [format(x,o),format((y * -1),o)].join(" ") end |