diff options
author | Thorsten Behrens <thb@openoffice.org> | 2003-11-12 11:11:24 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2003-11-12 11:11:24 +0000 |
commit | 6993a65de005cf20d7f6f8ed56b73ddcf9d92b3d (patch) | |
tree | d18f1b038f6e3fb7d0471c386239a0c7e6293597 /basegfx | |
parent | d29fb24a43fc4d8477181c2b693e163d97c07218 (diff) |
Added scalar cross() method to B2DVector, which returns length of the 2D cross product (useful e.g. for angle calculations)
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/vector/b2dvector.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/basegfx/source/vector/b2dvector.cxx b/basegfx/source/vector/b2dvector.cxx index 23044076d539..ed0325b446a5 100644 --- a/basegfx/source/vector/b2dvector.cxx +++ b/basegfx/source/vector/b2dvector.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dvector.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: aw $ $Date: 2003-11-11 09:56:10 $ + * last change: $Author: thb $ $Date: 2003-11-12 12:11:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -116,6 +116,11 @@ namespace basegfx return((mfX * rVec.mfX) + (mfY * rVec.mfY)); } + double B2DVector::cross( const B2DVector& rVec ) const + { + return(mfX * rVec.getY() - mfY * rVec.getX()); + } + double B2DVector::angle( const B2DVector& rVec ) const { return atan2(mfX * rVec.getY() - mfY * rVec.getX(), |