Class: Siren::Vec
- Inherits:
-
Object
- Object
- Siren::Vec
- Defined in:
- lib/vec.rb
Overview
Vec クラス拡張メソッド
Class Method Summary collapse
- .o ⇒ Object
- .x ⇒ Object
- .xdir ⇒ Object
- .xy ⇒ Object
- .xyz ⇒ Object
- .xz ⇒ Object
- .y ⇒ Object
- .ydir ⇒ Object
- .yx ⇒ Object
- .yz ⇒ Object
- .z ⇒ Object
- .zdir ⇒ Object
- .zero ⇒ Object
- .zx ⇒ Object
- .zy ⇒ Object
Instance Method Summary collapse
-
#to_a ⇒ Object
(also: #to_ary, #xyz)
Return x, y and z values of this object as an array.
-
#to_s ⇒ Object
(also: #inspect)
Return this object as a string.
Class Method Details
Instance Method Details
#to_a ⇒ Object Also known as: to_ary, xyz
Return x, y and z values of this object as an array.
75 76 77 |
# File 'lib/vec.rb', line 75 def to_a [self.x, self.y, self.z] end |
#to_s ⇒ Object Also known as: inspect
Return this object as a string.
68 69 70 |
# File 'lib/vec.rb', line 68 def to_s "#<Vec:0x%x @x=%f, @y=%f, @z=%f>" % [self.object_id, self.x, self.y, self.z] end |