Skip to content
Permalink
Browse files
better formatting
  • Loading branch information
Koyaani authored and nyalldawson committed Oct 20, 2021
1 parent 8667785 commit 406f17194d758f5999bf0c8656cf05e163c3ff04
Showing with 8 additions and 7 deletions.
  1. +8 −7 tests/src/core/geometry/testqgscircle.cpp
@@ -52,7 +52,6 @@ class TestQgsCircle: public QObject
void toCircularString();
void toString();
void asGML();

};

void TestQgsCircle::constructor()
@@ -225,19 +224,19 @@ void TestQgsCircle::minimalCircleFrom3points()

QGSCOMPARENEARPOINT( circ.center(), QgsPoint( 0, 0 ), 0.0001 );
QGSCOMPARENEAR( circ.radius(), 5.0, 0.0001 );
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ));
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ) );

circ = QgsCircle().minimalCircleFrom3Points( QgsPoint( 0, -5 ), QgsPoint( 1, 2 ), QgsPoint( 0, 5 ) );

QGSCOMPARENEARPOINT( circ.center(), QgsPoint( 0, 0 ), 0.0001 );
QGSCOMPARENEAR( circ.radius(), 5.0, 0.0001 );
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ));
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ) );

circ = QgsCircle().minimalCircleFrom3Points( QgsPoint( 1, 2 ), QgsPoint( 0, 5 ), QgsPoint( 0, -5 ));
circ = QgsCircle().minimalCircleFrom3Points( QgsPoint( 1, 2 ), QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) );

QGSCOMPARENEARPOINT( circ.center(), QgsPoint( 0, 0 ), 0.0001 );
QGSCOMPARENEAR( circ.radius(), 5.0, 0.0001 );
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ));
QCOMPARE( circ, QgsCircle().from2Points( QgsPoint( 0, 5 ), QgsPoint( 0, -5 ) ) );

// equivalent to from3Points
circ = QgsCircle().minimalCircleFrom3Points( QgsPoint( 0, 5 ), QgsPoint( 5, 0 ), QgsPoint( -5, 0 ) );
@@ -291,8 +290,10 @@ void TestQgsCircle::areaPerimeter()

void TestQgsCircle::boundingBox()
{
QVERIFY( QgsRectangle( QgsPointXY( -2.5, -2.5 ), QgsPointXY( 2.5, 2.5 ) ) == QgsCircle( QgsPoint( 0, 0 ), 2.5, 0 ).boundingBox() );
QVERIFY( QgsRectangle( QgsPointXY( -2.5, -2.5 ), QgsPointXY( 2.5, 2.5 ) ) == QgsCircle( QgsPoint( 0, 0 ), 2.5, 45 ).boundingBox() );
QVERIFY( QgsRectangle( QgsPointXY( -2.5, -2.5 ), QgsPointXY( 2.5, 2.5 ) )
== QgsCircle( QgsPoint( 0, 0 ), 2.5, 0 ).boundingBox() );
QVERIFY( QgsRectangle( QgsPointXY( -2.5, -2.5 ), QgsPointXY( 2.5, 2.5 ) )
== QgsCircle( QgsPoint( 0, 0 ), 2.5, 45 ).boundingBox() );
}

void TestQgsCircle::northQuadrant()

0 comments on commit 406f171

Please sign in to comment.