aboutsummaryrefslogtreecommitdiff
path: root/ray.go
diff options
context:
space:
mode:
authorMartin Lehoux <martin@lehoux.net>2020-04-04 14:49:42 -0700
committerMartin Lehoux <martin@lehoux.net>2020-04-04 14:49:42 -0700
commita9983fb8d3d1ecf955c6fe4339bb36fd22153abb (patch)
tree8049f957d2bf6d170bf7b9757846fe4a3ad4adcf /ray.go
parent658fd1f722932837901c11ae53eedf130ec662fd (diff)
feat - Basic Ray features
Diffstat (limited to 'ray.go')
-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))
+}