← Back to team overview

kicad-developers team mailing list archive

Re: Arc drawing: code vs comment

 

On 2019-06-11 14:00, Simon Richter wrote:
Hi,

I just stumbled across

    /* Please NOTE the different sign due to Y-axis flip */
    start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) );
    start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) );

at common/plotters/plotter.cpp:164.

Is that comment obsolete, or is there a bug here?

Neither. It is referring to the -stAngle. This flips the sin result sign but not the cos result. Perhaps it would be more clear if we used positive angle and flipped the sign in front of KiROUND but the outcome is the same.

-S


References