aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorThomas White <taw27@cam.ac.uk>2009-03-31 14:37:05 +0100
committerThomas White <taw27@cam.ac.uk>2009-03-31 14:37:05 +0100
commit4262a193f2eea72dfd1a268a312f2ce5be71a6f1 (patch)
tree7c9aa0e4a12d3110b10fce06a6415b10b13fdde8 /src/utils.c
parent81f877ffde3e67ef7e7b0dd0aa799d7c032ab37d (diff)
Reprojection improvements (previously on simple-search, lost, and now cherry-picked into master)
New line-sphere intersection mathematics (Slightly) more numerically stable quadratic formula Conflicts: src/reproject.c
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 30a6e34..01b14d9 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -39,6 +39,10 @@ double modulus(double x, double y, double z) {
return sqrt(x*x + y*y + z*z);
}
+double modulus_squared(double x, double y, double z) {
+ return x*x + y*y + z*z;
+}
+
double distance3d(double x1, double y1, double z1, double x2, double y2, double z2) {
return modulus(x1-x2, y1-y2, z1-z2);
}