Accord.Tests.Math.LineTest.RThetaTest C# (CSharp) Method

RThetaTest() private method

private RThetaTest ( float x, float y, float theta, float expectedRadius, float expectedSlope, float expectedIntercept ) : void
x float
y float
theta float
expectedRadius float
expectedSlope float
expectedIntercept float
return void
        public void RThetaTest(float x, float y, float theta, float expectedRadius, float expectedSlope, float expectedIntercept)
        {
            Point pt = new Point(x, y);

            // test Point-Theta factory
            Line line = Line.FromPointTheta(pt, theta);
            Assert.AreEqual(expectedSlope, line.Slope, Error);
            Assert.AreEqual(expectedIntercept, line.Intercept, Error);

            // calculate radius
            float radius = pt.EuclideanNorm();
            Assert.AreEqual(expectedRadius, radius, Error);

            // test R-Theta factory
            line = Line.FromRTheta(radius, theta);
            Assert.AreEqual(expectedSlope, line.Slope, Error);
            Assert.AreEqual(expectedIntercept, line.Intercept, Error);
        }