diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-08 03:21:47 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-08 03:21:47 +0000 |
commit | 67748e0e839d434cde6207cdc80b3e2a6f6e9097 (patch) | |
tree | c617a82ba7841b51d43c4cd303ae9119859a99ea /converter/other/pamtosvg/point.c | |
parent | 24ef77c17672db9412323197f0f4f6f632534cfb (diff) | |
download | netpbm-mirror-67748e0e839d434cde6207cdc80b3e2a6f6e9097.tar.gz netpbm-mirror-67748e0e839d434cde6207cdc80b3e2a6f6e9097.tar.xz netpbm-mirror-67748e0e839d434cde6207cdc80b3e2a6f6e9097.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4638 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtosvg/point.c')
-rw-r--r-- | converter/other/pamtosvg/point.c | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/converter/other/pamtosvg/point.c b/converter/other/pamtosvg/point.c index 6a9ffafa..94502d83 100644 --- a/converter/other/pamtosvg/point.c +++ b/converter/other/pamtosvg/point.c @@ -4,12 +4,21 @@ #include "point.h" -float_coord -makePoint(float const x, - float const y, - float const z) { - float_coord retval; + +/* 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. +*/ + + + +Point +point_make(float const x, + float const y, + float const z) { + + Point retval; retval.x = x; retval.y = y; @@ -21,8 +30,8 @@ makePoint(float const x, bool -pointsEqual(float_coord const comparand, - float_coord const comparator) { +point_equal(Point const comparand, + Point const comparator) { return epsilon_equal(comparand.x, comparator.x) @@ -35,3 +44,33 @@ pointsEqual(float_coord const comparand, +Point +point_sum(Point const coord1, + Point const coord2) { + + Point retval; + + retval.x = coord1.x + coord2.x; + retval.y = coord1.y + coord2.y; + retval.z = coord1.z + coord2.z; + + return retval; +} + + + +Point +point_scaled(Point const coord, + float const r) { + + Point retval; + + retval.x = coord.x * r; + retval.y = coord.y * r; + retval.z = coord.z * r; + + return retval; +} + + + |