From 10c03e4651e7a6a5ae540bacd8e586407f36aa49 Mon Sep 17 00:00:00 2001 From: GaugeAndGravity Date: Mon, 30 Oct 2023 13:18:43 -0400 Subject: [PATCH] fix normalize --- raytrace_2D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raytrace_2D.py b/raytrace_2D.py index d7e37a5..310defc 100644 --- a/raytrace_2D.py +++ b/raytrace_2D.py @@ -55,7 +55,7 @@ class Disk(Shapes): if t < 0: return None, None intersection_point = ray.origin + t * ray.direction - intersection_point = intersection_point/np.linalg.norm(intersection_point) + intersection_point = self.center + self.radius * (intersection_point - self.center)/np.linalg.norm(intersection_point - self.center) return t,intersection_point def get_normal(self, point): normal = (point - self.center)/self.radius