basis-processing 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/.gitignore +1 -0
  2. data/basis.gemspec +1 -1
  3. data/lib/screen.rb +4 -1
  4. metadata +4 -4
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.*~
2
+ *.gem
data/basis.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = "basis-processing"
3
- s.version = "0.4.6"
3
+ s.version = "0.4.7"
4
4
  s.author = "Avishek Sen Gupta"
5
5
  s.email = "avishek.sen.gupta@gmail.com"
6
6
  s.homepage = "http://avishek.net/blog"
data/lib/screen.rb CHANGED
@@ -6,14 +6,17 @@ class Screen
6
6
  @artist = artist
7
7
  end
8
8
 
9
- def plot(point, basis, &block)
9
+ def plot(point, basis, options = {:bar => false}, &block)
10
10
  standard_point = basis.standard_basis(point)
11
11
  p = @transform.apply(standard_point)
12
+
13
+ standard_x_axis_point = @transform.apply(basis.standard_basis({:x => point[:x], :y => 0}))
12
14
  if (block)
13
15
  block.call(p)
14
16
  else
15
17
  @artist.ellipse(p[:x], p[:y], 5, 5)
16
18
  end
19
+ @artist.line(standard_x_axis_point[:x], standard_x_axis_point[:y], p[:x], p[:y]) if options[:bar]
17
20
  end
18
21
 
19
22
  def original(onscreen_point, basis)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basis-processing
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 6
10
- version: 0.4.6
9
+ - 7
10
+ version: 0.4.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Avishek Sen Gupta
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-22 00:00:00 Z
18
+ date: 2011-10-01 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Basis provides a set of classes for easily plotting and transforming arbitrary 2D coordinate systems by specifying their basis vectors in Ruby-Processing.