module Point
Constants
- VERSION
Public Class Methods
get_quadrant(point)
click to toggle source
# File lib/points.rb, line 21 def self.get_quadrant(point) x = get_x(point) y = get_y(point) if x.positive? return 1 if y.positive? return 4 if y.negative? end if x.negative? return 2 if y.positive? return 3 if y.negative? end end
get_x(point)
click to toggle source
# File lib/points.rb, line 9 def self.get_x(point) Pairs.car(point) end
get_y(point)
click to toggle source
# File lib/points.rb, line 13 def self.get_y(point) Pairs.cdr(point) end
make(x, y)
click to toggle source
# File lib/points.rb, line 5 def self.make(x, y) Pairs.cons(x, y) end
to_string(point)
click to toggle source
# File lib/points.rb, line 17 def self.to_string(point) Pairs.to_string(point) end