Class: Raster::Vector

Inherits:
Struct
  • Object
show all
Defined in:
lib/skrift/raster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#xObject

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x



4
5
6
# File 'lib/skrift/raster.rb', line 4

def x
  @x
end

#yObject

Returns the value of attribute y

Returns:

  • (Object)

    the current value of y



4
5
6
# File 'lib/skrift/raster.rb', line 4

def y
  @y
end

Instance Method Details

#*(f) ⇒ Object



5
# File 'lib/skrift/raster.rb', line 5

def*(f) = Vector[x*f,y*f]

#+(o) ⇒ Object



6
# File 'lib/skrift/raster.rb', line 6

def+(o) = Vector[x+o[0],y+o[1]]

#-(o) ⇒ Object



7
# File 'lib/skrift/raster.rb', line 7

def-(o) = Vector[x-o[0],y-o[1]]

#minObject



8
# File 'lib/skrift/raster.rb', line 8

def min = (x < y ? x : y)