File indexing completed on 2024-12-15 04:02:36

0001 /*
0002  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #include "TernaryConstants.h"
0010 
0011 #include <cmath>
0012 
0013 using namespace std;
0014 
0015 using namespace std;
0016 
0017 extern const qreal Sqrt3 = sqrt( 3.0 );
0018 extern const qreal TriangleWidth = 1.0;
0019 extern const qreal TriangleHeight = 0.5 * Sqrt3;
0020 extern const QPointF TriangleTop( 0.5, TriangleHeight );
0021 extern const QPointF TriangleBottomLeft( 0.0, 0.0 );
0022 extern const QPointF TriangleBottomRight( 1.0, 0.0 );
0023 extern const QPointF AxisVector_C_A( TriangleTop - TriangleBottomRight );
0024 extern const QPointF Norm_C_A( -AxisVector_C_A.y(), AxisVector_C_A.x() );
0025 extern const QPointF AxisVector_B_A( TriangleTop );
0026 extern const QPointF Norm_B_A( -AxisVector_B_A.y(), AxisVector_B_A.x() );
0027 extern const QPointF AxisVector_B_C( TriangleBottomRight );
0028 extern const QPointF Norm_B_C( -AxisVector_B_C.y(), AxisVector_B_C.x() );
0029 
0030 extern const qreal RelMarkerLength = 0.03 * TriangleWidth;
0031 extern const QPointF FullMarkerDistanceBC( RelMarkerLength * Norm_B_C );
0032 extern const QPointF FullMarkerDistanceAC( -RelMarkerLength * Norm_C_A );
0033 extern const QPointF FullMarkerDistanceBA( RelMarkerLength * Norm_B_A );
0034