struct Chem::Spatial::Size
- Chem::Spatial::Size
- Struct
- Value
- Object
Defined in:
chem/spatial/size.crConstructors
- .[](x : Float64, y : Float64, z : Float64) : self
- .new(x : Float64, y : Float64, z : Float64)
- .zero : self
Instance Method Summary
- #*(rhs : Number) : self
- #/(rhs : Number) : self
-
#[](index : Int) : Float64
Returns the element at index.
-
#[]?(index : Int) : Float64 | Nil
Returns the element at index.
- #volume : Float64
- #x : Float64
- #y : Float64
- #z : Float64
Constructor Detail
Instance Method Detail
Returns the element at index. Raises IndexError
if index is
out of bounds.
ary = Size[10, 15, 20]
ary[0] # => 10
ary[1] # => 15
ary[2] # => 20
ary[3] # raises IndexError
ary[-1] # raises IndexError
Returns the element at index. Returns nil
if index is out of
bounds.
ary = Size[10, 15, 20]
ary[0]? # => 10
ary[1]? # => 15
ary[2]? # => 20
ary[3]? # => nil
ary[-1]? # => nil