From d807fc8d15c9378c726fd6bfc1576734fb5b32c3 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 21 Feb 2008 16:38:55 +0000 Subject: Add Pdirection() git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@586 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pamtosvg/vector.c | 9 +++++++++ converter/other/pamtosvg/vector.h | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'converter/other') 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 -- cgit 1.4.1