diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-22 18:46:44 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-22 18:46:44 +0000 |
commit | 19e1e241458117e69b8334838ef7a1fad9b5fdb5 (patch) | |
tree | 55ab3a3b4d8ebeacf30aa6dc06304e3d98fc0f24 /converter/other/pamtosvg/point.c | |
parent | bed3a3f11d7e0f788d5f61b2175bc4e887491fa4 (diff) | |
download | netpbm-mirror-19e1e241458117e69b8334838ef7a1fad9b5fdb5.tar.gz netpbm-mirror-19e1e241458117e69b8334838ef7a1fad9b5fdb5.tar.xz netpbm-mirror-19e1e241458117e69b8334838ef7a1fad9b5fdb5.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4677 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtosvg/point.c')
-rw-r--r-- | converter/other/pamtosvg/point.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/converter/other/pamtosvg/point.c b/converter/other/pamtosvg/point.c index 690f6d80..0e10b6b6 100644 --- a/converter/other/pamtosvg/point.c +++ b/converter/other/pamtosvg/point.c @@ -1,4 +1,5 @@ #include <stdbool.h> +#include <math.h> #include "epsilon.h" @@ -74,3 +75,16 @@ point_scaled(Point const coord, +float +point_distance(Point const p1, + Point const p2) { +/*---------------------------------------------------------------------------- + Return the Euclidean distance between 'p1' and 'p2'. +-----------------------------------------------------------------------------*/ + float const x = p1.x - p2.x, y = p1.y - p2.y, z = p1.z - p2.z; + + return (float) sqrt(SQR(x) + SQR(y) + SQR(z)); +} + + + |