summaryrefslogtreecommitdiffstats
path: root/libdimension/sphere.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/sphere.c')
-rw-r--r--libdimension/sphere.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libdimension/sphere.c b/libdimension/sphere.c
index a14070e..74f414d 100644
--- a/libdimension/sphere.c
+++ b/libdimension/sphere.c
@@ -22,8 +22,10 @@
#include <stdlib.h> /* For malloc */
#include <math.h> /* For sqrt */
-static dmnsn_array *dmnsn_sphere_intersections_fn(dmnsn_line line);
-static int dmnsn_sphere_inside_fn(dmnsn_vector point);
+static dmnsn_array *dmnsn_sphere_intersections_fn(const dmnsn_sphere *sphere,
+ dmnsn_line line);
+static int dmnsn_sphere_inside_fn(const dmnsn_sphere *sphere,
+ dmnsn_vector point);
dmnsn_object *
dmnsn_new_sphere()
@@ -43,7 +45,7 @@ dmnsn_delete_sphere(dmnsn_object *sphere)
}
static dmnsn_array *
-dmnsn_sphere_intersections_fn(dmnsn_line line)
+dmnsn_sphere_intersections_fn(const dmnsn_object *sphere, dmnsn_line line)
{
double a, b, c, t[2];
dmnsn_array *array = dmnsn_new_array(sizeof(double));
@@ -65,7 +67,7 @@ dmnsn_sphere_intersections_fn(dmnsn_line line)
}
static int
-dmnsn_sphere_inside_fn(dmnsn_vector point)
+dmnsn_sphere_inside_fn(const dmnsn_object *sphere, dmnsn_vector point)
{
return sqrt(point.x*point.x + point.y*point.y + point.z*point.z) < 1.0;
}