draco1023 / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

RotateBilinear optimization #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the RotateBilinear class I see the following two lines:

                        // coordinates of source point
                        ox =  angleCos * cx + angleSin * cy + halfWidth;
                        oy = -angleSin * cx + angleCos * cy + halfHeight;

These are placed within the nested for loop iterating in the x direction.
This can be placed outside the loop as it does not need to be calculated 
again.
What version of the product are you using?
2.1.0.0

Please provide any additional information below.

Original issue reported on code.google.com by MichaelL...@gmail.com on 15 Jan 2010 at 11:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Correction:
outside the loop:
// coordinates of source point
double tox = angleSin * cy + halfWidth;
double toy = angleCos * cy + halfHeight;

and inside the loop:
ox = angleCos * cx + tox;
oy = -angleSin * cx + toy;

ofcourse I do realize that it's written for clarity.

Original comment by MichaelL...@gmail.com on 16 Jan 2010 at 12:02

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 18 Jan 2010 at 8:27

GoogleCodeExporter commented 9 years ago
Thank you for noticing this issue.

Committed in revision 1154. Will be released in version 2.1.1.

Original comment by andrew.k...@gmail.com on 18 Jan 2010 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 24 Jan 2010 at 2:31