AForge.DoublePoint.Round C# (CSharp) Method

Round() public method

Rounds the double precision point.
public Round ( ) : IntPoint
return IntPoint
        public IntPoint Round( )
        {
            return new IntPoint( (int) Math.Round( X ), (int) Math.Round( Y ) );
        }

Usage Example

Example #1
0
        public void RoundTest( double x, double y, int expectedX, int expectedY )
        {
            DoublePoint dPoint = new DoublePoint( x, y );
            IntPoint    iPoint = new IntPoint( expectedX, expectedY );

            Assert.AreEqual( iPoint, dPoint.Round( ) );
        }