Class: Geom3d::Ray
- Inherits:
-
Object
- Object
- Geom3d::Ray
- Defined in:
- lib/geom3d/ray.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(start, dir) ⇒ Ray
constructor
A new instance of Ray.
- #pos(t) ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
6 7 8 |
# File 'lib/geom3d/ray.rb', line 6 def dir @dir end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
6 7 8 |
# File 'lib/geom3d/ray.rb', line 6 def start @start end |
Instance Method Details
#pos(t) ⇒ Object
13 14 15 |
# File 'lib/geom3d/ray.rb', line 13 def pos t @start + t * @dir end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/geom3d/ray.rb', line 17 def to_s "Ray(#{@start.to_s},#{@dir.to_s}" end |