From 2c489b9e301f24c6df9b79946c65a04e0c825e6b Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 21 Feb 2008 05:02:01 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@585 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pamtosvg/vector.h | 66 ++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 19 deletions(-) (limited to 'converter/other/pamtosvg/vector.h') diff --git a/converter/other/pamtosvg/vector.h b/converter/other/pamtosvg/vector.h index 74fb2fd2..b3a5454e 100644 --- a/converter/other/pamtosvg/vector.h +++ b/converter/other/pamtosvg/vector.h @@ -15,32 +15,54 @@ typedef struct /* Consider a point as a vector from the origin. */ -extern vector_type make_vector (const float_coord); +vector_type +make_vector(float_coord const); /* And a vector as a point, i.e., a displacement from the origin. */ -extern float_coord vector_to_point (const vector_type); +float_coord +vector_to_point(vector_type const); /* Definitions for these common operations can be found in any decent linear algebra book, and most calculus books. */ -extern float magnitude (const vector_type); -extern vector_type normalize (const vector_type); +float +magnitude(vector_type const); + +vector_type +normalize(vector_type const); + +vector_type +Vadd(vector_type const, + vector_type const); + +float +Vdot(vector_type const, + vector_type const); + +vector_type +Vmult_scalar(vector_type const, + float const); -extern vector_type Vadd (const vector_type, const vector_type); -extern float Vdot (const vector_type, const vector_type); -extern vector_type Vmult_scalar (const vector_type, const float); -extern float Vangle (const vector_type in, const vector_type out, at_exception_type * exp); +float +Vangle(vector_type const in, + vector_type const out, + at_exception_type * const exP); /* These operations could have been named `P..._vector' just as well as V..._point, so we may as well allow both names. */ + #define Padd_vector Vadd_point -extern float_coord Vadd_point - (const float_coord, const vector_type); + +float_coord +Vadd_point(float_coord const, + vector_type const); #define Psubtract_vector Vsubtract_point -extern float_coord Vsubtract_point - (const float_coord, const vector_type); + +float_coord +Vsubtract_point(float_coord const, + vector_type const); /* This returns the rounded sum. */ #define IPadd_vector Vadd_int_point @@ -50,22 +72,28 @@ Vadd_int_point(pm_pixelcoord const c, vector_type const v); /* Take the absolute value of both components. */ -extern vector_type Vabs (const vector_type); +vector_type +Vabs(vector_type const); /* Operations on points with real coordinates. It is not orthogonal, but more convenient, to have the subtraction operator return a vector, and the addition operator return a point. */ -extern vector_type Psubtract - (const float_coord, const float_coord); +vector_type +Psubtract(float_coord const, + float_coord const); vector_type IPsubtract(pm_pixelcoord const coord1, pm_pixelcoord const coord2); /* These are heavily used in spline fitting. */ -extern float_coord Padd (const float_coord, - const float_coord); -extern float_coord Pmult_scalar (const float_coord, const float); -#endif +float_coord +Padd(float_coord const, + float_coord const); +float_coord +Pmult_scalar(float_coord const, + float const); + +#endif -- cgit 1.4.1