Method: Geometry::Rotation.new

Defined in:
lib/aurora-geometry/rotation.rb

.new(angle) ⇒ Object

Create a planar Geometry::Rotation with an angle



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/aurora-geometry/rotation.rb', line 23

def self.new(*args)
    options = args.select {|a| a.is_a? Hash}.reduce({}, :merge)

    if options.has_key? :angle
	RotationAngle.new options[:angle]
elsif options.has_key?(:x) && [:x, :y, :z].one? {|k| options.has_key? k }
	RotationAngle.new x:options[:x]
    else
	self.allocate.tap {|rotation| rotation.send :initialize, *args }
    end
end