Class: Pathby::Point
- Inherits:
-
Struct
- Object
- Struct
- Pathby::Point
- Includes:
- Transformations
- Defined in:
- lib/pathby.rb,
lib/pathby.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
Methods included from Transformations
#center, #reflect, #rezero, #rotate, #scale, #scale_to, #simplebbox, #transform
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
6 7 8 |
# File 'lib/pathby.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y
6 7 8 |
# File 'lib/pathby.rb', line 6 def y @y end |
Instance Method Details
#allpoints ⇒ Object
17 18 19 |
# File 'lib/pathby.rb', line 17 def allpoints return [self] end |
#applytransform(m) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/pathby.rb', line 25 def applytransform(m) v = Matrix[[self.x],[self.y],[1]] v = m*v self.x = v[0,0] self.y = v[1,0] return self end |
#toPathData ⇒ Object
21 22 23 |
# File 'lib/pathby.rb', line 21 def toPathData return "#{'%.2f' % x} #{'%.2f' % y}" end |