Class: StructuraidCore::Engineering::Locations::Absolute
- Defined in:
- lib/structuraid_core/engineering/locations/absolute.rb
Instance Attribute Summary collapse
-
#value_x ⇒ Object
readonly
Returns the value of attribute value_x.
-
#value_y ⇒ Object
readonly
Returns the value of attribute value_y.
-
#value_z ⇒ Object
readonly
Returns the value of attribute value_z.
Instance Method Summary collapse
-
#initialize(value_x:, value_y:, value_z:) ⇒ Absolute
constructor
A new instance of Absolute.
- #to_matrix ⇒ Object
- #to_vector ⇒ Object
Constructor Details
#initialize(value_x:, value_y:, value_z:) ⇒ Absolute
Returns a new instance of Absolute.
9 10 11 12 13 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 9 def initialize(value_x:, value_y:, value_z:) @value_x = value_x.to_f @value_y = value_y.to_f @value_z = value_z.to_f end |
Instance Attribute Details
#value_x ⇒ Object (readonly)
Returns the value of attribute value_x.
7 8 9 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 7 def value_x @value_x end |
#value_y ⇒ Object (readonly)
Returns the value of attribute value_y.
7 8 9 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 7 def value_y @value_y end |
#value_z ⇒ Object (readonly)
Returns the value of attribute value_z.
7 8 9 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 7 def value_z @value_z end |
Instance Method Details
#to_matrix ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 15 def to_matrix Matrix.column_vector( [ value_x, value_y, value_z ] ) end |
#to_vector ⇒ Object
25 26 27 |
# File 'lib/structuraid_core/engineering/locations/absolute.rb', line 25 def to_vector Vector[value_x, value_y, value_z] end |