from dataclasses import dataclass

from geometry.vector import Vector


@dataclass
class Ray:
  r0: Vector
  e: Vector

  def __post_init__(self):
    self.e = self.e.normalize()

  def prolong(self, t: float) -> Vector:
    return self.r0 + self.e * t
