Method: Processing::GraphicsContext#angleMode
- Defined in:
- lib/processing/graphics_context.rb
#angleMode(mode = nil) ⇒ RADIANS, DEGREES
Sets angle mode.
849 850 851 852 853 854 855 856 857 858 859 860 |
# File 'lib/processing/graphics_context.rb', line 849 def angleMode(mode = nil) if mode != nil @angleMode__ = mode @toRad__, @toDeg__, @fromRad__, @fromDeg__ = case mode.downcase.to_sym when RADIANS then [1.0, RAD2DEG__, 1.0, DEG2RAD__] when DEGREES then [DEG2RAD__, 1.0, RAD2DEG__, 1.0] else raise ArgumentError, "invalid angle mode: #{mode}" end end @angleMode__ end |