Method: Geometry::Line.new

Defined in:
lib/geometry/line.rb

.new(from, to) ⇒ TwoPointLine .new(start, end) ⇒ TwoPointLine

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

Returns:



69
70
71
72
73
74
75
76
77
78
# File 'lib/geometry/line.rb', line 69

def self.new(options={})
    from = options[:from] || options[:start]
    to = options[:end] || options[:to]

    if from and to
	TwoPointLine.new(from, to)
    else
	raise ArgumentError, "Start and end Points must be provided"
    end
end