00001 /**************************************************************************** 00002 ** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Chart library. 00005 ** 00006 ** Licensees holding valid commercial KD Chart licenses may use this file in 00007 ** accordance with the KD Chart Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 00023 #include "TernaryConstants.h" 00024 00025 #include <cmath> 00026 00027 using namespace std; 00028 00029 extern const double Sqrt3 = sqrt( 3.0 ); 00030 extern const double TriangleWidth = 1.0; 00031 extern const double TriangleHeight = 0.5 * Sqrt3; 00032 extern const QPointF TriangleTop( 0.5, TriangleHeight ); 00033 extern const QPointF TriangleBottomLeft( 0.0, 0.0 ); 00034 extern const QPointF TriangleBottomRight( 1.0, 0.0 ); 00035 extern const QPointF AxisVector_C_A( TriangleTop - TriangleBottomRight ); 00036 extern const QPointF Norm_C_A( -AxisVector_C_A.y(), AxisVector_C_A.x() ); 00037 extern const QPointF AxisVector_B_A( TriangleTop ); 00038 extern const QPointF Norm_B_A( -AxisVector_B_A.y(), AxisVector_B_A.x() ); 00039 extern const QPointF AxisVector_B_C( TriangleBottomRight ); 00040 extern const QPointF Norm_B_C( -AxisVector_B_C.y(), AxisVector_B_C.x() ); 00041 00042 extern const double RelMarkerLength = 0.03 * TriangleWidth; 00043 extern const QPointF FullMarkerDistanceBC( RelMarkerLength * Norm_B_C ); 00044 extern const QPointF FullMarkerDistanceAC( -RelMarkerLength * Norm_C_A ); 00045 extern const QPointF FullMarkerDistanceBA( RelMarkerLength * Norm_B_A ); 00046