about summary refs log tree commit diff
path: root/converter/other/pamtosvg
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-02-21 16:38:55 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-02-21 16:38:55 +0000
commitd807fc8d15c9378c726fd6bfc1576734fb5b32c3 (patch)
treea9869c167bf61b550175f816df4ef2c1b3946a4b /converter/other/pamtosvg
parent2c489b9e301f24c6df9b79946c65a04e0c825e6b (diff)
downloadnetpbm-mirror-d807fc8d15c9378c726fd6bfc1576734fb5b32c3.tar.gz
netpbm-mirror-d807fc8d15c9378c726fd6bfc1576734fb5b32c3.tar.xz
netpbm-mirror-d807fc8d15c9378c726fd6bfc1576734fb5b32c3.zip
Add Pdirection()
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@586 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtosvg')
-rw-r--r--converter/other/pamtosvg/vector.c9
-rw-r--r--converter/other/pamtosvg/vector.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/converter/other/pamtosvg/vector.c b/converter/other/pamtosvg/vector.c
index 43e1872e..e25c1068 100644
--- a/converter/other/pamtosvg/vector.c
+++ b/converter/other/pamtosvg/vector.c
@@ -235,6 +235,15 @@ Psubtract(float_coord const c1,
 
 
 
+vector_type
+Pdirection(float_coord const final,
+           float_coord const initial) {
+
+    return normalize(Psubtract(final, initial));
+}
+
+
+
 /* Operations on integer points.  */
 
 vector_type
diff --git a/converter/other/pamtosvg/vector.h b/converter/other/pamtosvg/vector.h
index b3a5454e..b5c85c38 100644
--- a/converter/other/pamtosvg/vector.h
+++ b/converter/other/pamtosvg/vector.h
@@ -64,6 +64,10 @@ float_coord
 Vsubtract_point(float_coord const,
                 vector_type const);
 
+vector_type
+Pdirection(float_coord const final,
+           float_coord const initial);
+
 /* This returns the rounded sum.  */
 #define IPadd_vector Vadd_int_point