From 50b99e5aefed331d9363f0e61fc1c1a6b8416844 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 12 Mar 2015 19:07:53 +0300 Subject: [PATCH] fix compilation on MSVS2010 --- .../ml/introduction_to_pca/introduction_to_pca.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp b/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp index 71a0b7263..52f9e49f4 100644 --- a/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp +++ b/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp @@ -23,7 +23,7 @@ void drawAxis(Mat& img, Point p, Point q, Scalar colour, const float scale = 0.2 double angle; double hypotenuse; angle = atan2( (double) p.y - q.y, (double) p.x - q.x ); // angle in radians - hypotenuse = sqrt( (p.y - q.y) * (p.y - q.y) + (p.x - q.x) * (p.x - q.x)); + hypotenuse = sqrt( (double) (p.y - q.y) * (p.y - q.y) + (p.x - q.x) * (p.x - q.x)); // double degrees = angle * 180 / CV_PI; // convert radians to degrees (0-180 range) // cout << "Degrees: " << abs(degrees - 180) << endl; // angle in 0-360 degrees range