aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ray.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/ray.go b/ray.go
new file mode 100644
index 0000000..c874e31
--- /dev/null
+++ b/ray.go
@@ -0,0 +1,9 @@
+package main
+
+type Ray struct {
+ origin, direction Vec3D
+}
+
+func (ray Ray) PointAt(time float64) Vec3D {
+ return AddVec3D(ray.origin, ScalarProduct(time, ray.direction))
+}