Class: Mageo::Sphere

Inherits:
Object
  • Object
show all
Defined in:
lib/mageo/sphere.rb

Overview

球を表現するクラス。

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position, radius) ⇒ Sphere

座標と半径



10
11
12
13
# File 'lib/mageo/sphere.rb', line 10

def initialize(position, radius)
  @position = Mageo::Vector3D[*position]
  @radius = radius
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



7
8
9
# File 'lib/mageo/sphere.rb', line 7

def position
  @position
end

#radiusObject (readonly)

Returns the value of attribute radius.



7
8
9
# File 'lib/mageo/sphere.rb', line 7

def radius
  @radius
end