class Rubyvis::Transform

Attributes

k[RW]
x[RW]
y[RW]

Public Class Methods

identity() click to toggle source
# File lib/rubyvis/transform.rb, line 20
def self.identity
  Transform.new
end
new() click to toggle source
# File lib/rubyvis/transform.rb, line 7
def initialize
  @k=1
  @x=0
  @y=0
end

Public Instance Methods

translate(x,y) click to toggle source
# File lib/rubyvis/transform.rb, line 12
def translate(x,y)
  v=Transform.new
  v.k=self.k
  v.x=self.k*x+self.x
  v.y=self.k*y+self.y
  v

end