summaryrefslogtreecommitdiff
path: root/basegfx/source/vector
diff options
context:
space:
mode:
authorPascal Junck <pjunck@openoffice.org>2004-11-03 07:40:02 +0000
committerPascal Junck <pjunck@openoffice.org>2004-11-03 07:40:02 +0000
commitd68c0234034df265d71b07a774658541593a571b (patch)
tree395269d57170f72a2b8243388b7a1b94e95d026f /basegfx/source/vector
parent29ee57b7da00ce1844141a7ed246a314c99061d4 (diff)
INTEGRATION: CWS aw019 (1.10.36); FILE MERGED
2004/10/13 14:00:47 aw 1.10.36.2: #i34831# 2004/10/13 08:30:49 aw 1.10.36.1: #i34831#
Diffstat (limited to 'basegfx/source/vector')
-rw-r--r--basegfx/source/vector/b2dvector.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/basegfx/source/vector/b2dvector.cxx b/basegfx/source/vector/b2dvector.cxx
index 7614de743334..a9d7945a37b2 100644
--- a/basegfx/source/vector/b2dvector.cxx
+++ b/basegfx/source/vector/b2dvector.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dvector.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: aw $ $Date: 2004-01-16 14:30:10 $
+ * last change: $Author: pjunck $ $Date: 2004-11-03 08:40:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -180,17 +180,19 @@ namespace basegfx
{
double fVal(rVecA.getX() * rVecB.getY() - rVecA.getY() * rVecB.getX());
+ if(::basegfx::fTools::equalZero(fVal))
+ {
+ return ORIENTATION_NEUTRAL;
+ }
+
if(fVal > 0.0)
{
return ORIENTATION_POSITIVE;
}
-
- if(fVal < 0.0)
+ else
{
return ORIENTATION_NEGATIVE;
}
-
- return ORIENTATION_NEUTRAL;
}
B2DVector getPerpendicular( const B2DVector& rNormalizedVec )
@@ -199,6 +201,16 @@ namespace basegfx
return aPerpendicular;
}
+ B2DVector getNormalizedPerpendicular( const B2DVector& rVec )
+ {
+ B2DVector aPerpendicular(rVec);
+ aPerpendicular.normalize();
+ const double aTemp(-aPerpendicular.getY());
+ aPerpendicular.setY(aPerpendicular.getX());
+ aPerpendicular.setX(aTemp);
+ return aPerpendicular;
+ }
+
B2DVector operator*( const ::basegfx::B2DHomMatrix& rMat, const B2DVector& rVec )
{
B2DVector aRes( rVec );