diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-12-02 23:14:54 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-12-02 23:14:54 +0000 |
| commit | c17292fc068e26bbcefcc8778daa5cb07c82f065 (patch) | |
| tree | 32f34d1c96cc45518536a2b29ca6c3d674d1b094 /src/util | |
| parent | copyedit labels for clarity (diff) | |
| download | inkscape-c17292fc068e26bbcefcc8778daa5cb07c82f065.tar.gz inkscape-c17292fc068e26bbcefcc8778daa5cb07c82f065.zip | |
Fix compile. Don't #include .cpp files!
(bzr r4157)
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/util/mathfns.h | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/util/Makefile_insert b/src/util/Makefile_insert index 41d3b9fb4..913dda26b 100644 --- a/src/util/Makefile_insert +++ b/src/util/Makefile_insert @@ -16,6 +16,7 @@ util_libinkutil_a_SOURCES = \ util/list.h \ util/list-container.h \ util/map-list.h \ + util/mathfns.h \ util/reverse-list.h \ util/share.h \ util/share.cpp \ diff --git a/src/util/mathfns.h b/src/util/mathfns.h new file mode 100644 index 000000000..9ebd8bc2f --- /dev/null +++ b/src/util/mathfns.h @@ -0,0 +1,43 @@ +/* + * Inkscape::Util::... some mathmatical functions + * + * Authors: + * Johan Engelen <goejendaagh@zonnet.nl> + * + * Copyright (C) 2007 Johan Engelen + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef SEEN_INKSCAPE_UTIL_MATHFNS_H +#define SEEN_INKSCAPE_UTIL_MATHFNS_H + + +namespace Inkscape { + +namespace Util { + +/** + * Returns area in triangle given by points; may be negative. + */ +inline double +triangle_area (NR::Point p1, NR::Point p2, NR::Point p3) +{ + return (p1[NR::X]*p2[NR::Y] + p1[NR::Y]*p3[NR::X] + p2[NR::X]*p3[NR::Y] - p2[NR::Y]*p3[NR::X] - p1[NR::Y]*p2[NR::X] - p1[NR::X]*p3[NR::Y]); +} + +} + +} + +#endif +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
