class Cylinder

Attributes

axis[RW]
height[RW]
radius[RW]

Public Class Methods

new(radius, height, axis) click to toggle source
# File lib/roby/state/shapes.rb, line 3
def initialize(radius, height, axis)
    @radius, @height, @axis = radius.to_f, height.to_f, axis.to_f
end

Public Instance Methods

diameter(axis) click to toggle source
# File lib/roby/state/shapes.rb, line 6
def diameter(axis)
    if axis == self.axis
        radius * 2
    else
        raise NotImplementedError
    end
end
Also aliased as: max_length
length() click to toggle source
# File lib/roby/state/shapes.rb, line 14
def length; diameter(:z) end
max_length(axis)
Alias for: diameter
width() click to toggle source
# File lib/roby/state/shapes.rb, line 15
def width; diameter(:z) end