termular 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/termular/graph.rb +2 -0
  2. metadata +5 -5
@@ -110,6 +110,7 @@ module Termular
110
110
  0.upto(Console.cols).map { |x| screen_to_point(x, 0)[0] }.each do |x|
111
111
  ctx["x"] = x
112
112
  py = expression.eval ctx
113
+ next if py.is_a? Complex or (py.respond_to? :nan and py.nan?)
113
114
  scr_pt = point_to_screen(x, py)
114
115
  new_y = scr_pt[1]
115
116
  (old_y ? (old_y > new_y ? (old_y - 1).downto(new_y) : (old_y < new_y ? (old_y + 1).upto(new_y) : [new_y])) : [new_y]).each do |y|
@@ -138,6 +139,7 @@ module Termular
138
139
  (options["tmin"] || 0).upto(((options["tmax"] || 2 * Math::PI) * 100).round).map { |t| t / 100.0 }.each do |theta|
139
140
  ctx["t"] = theta
140
141
  radius = expression.eval ctx
142
+ next if radius.is_a? Complex or (radius.responds_to? :nan and radius.nan?)
141
143
  scr_pt = point_to_screen(radius*Math.cos(theta), radius*Math.sin(theta))
142
144
  if scr_pt[0] >= 0 and scr_pt[0] <= Console.cols and scr_pt[1] >= 0 and scr_pt[1] <= Console.rows
143
145
  buff << Console.move(scr_pt[0], scr_pt[1])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ncurses-ruby
16
- requirement: &2152096840 !ruby/object:Gem::Requirement
16
+ requirement: &2151895520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152096840
24
+ version_requirements: *2151895520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: paint
27
- requirement: &2152095940 !ruby/object:Gem::Requirement
27
+ requirement: &2151894800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152095940
35
+ version_requirements: *2151894800
36
36
  description: Termular Grapher is a simple graphing program that's capable of cartesian
37
37
  and polar graphs
38
38
  email: