diff --git a/pcb_calculator/transline/transline.cpp b/pcb_calculator/transline/transline.cpp index ccde93ff2d..97af47138b 100644 --- a/pcb_calculator/transline/transline.cpp +++ b/pcb_calculator/transline/transline.cpp @@ -72,6 +72,8 @@ TRANSLINE::TRANSLINE() m_parameters[MURC_PRM] = 1.0; m_Name = nullptr; ang_l = 0.0; // Electrical length in angle + len = 0.0; // length of line + er_eff = 1.0; // effective dielectric constant Init(); } diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 8a4e9debfb..51cbc6e86b 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -674,8 +674,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildModuleList( std::vector& aBadRefD int errorcount = 0; unsigned int backstartrefdes; - - size_t firstnum, changearraysize; + size_t firstnum = 0; m_FrontModules.clear(); m_BackModules.clear(); @@ -798,7 +797,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildModuleList( std::vector& aBadRefD LogChangePlan(); - changearraysize = m_ChangeArray.size(); + size_t changearraysize = m_ChangeArray.size(); for( size_t i = 0; i < changearraysize; i++ ) //Scan through for duplicates if update or skip { diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index 9698b35321..6cb385bbe7 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -607,16 +607,13 @@ void POINT_EDITOR::updateItem() const } else { - double tan = mid.y / static_cast( mid.x ); - double tmp = mid.x; // Circle : x^2 + y^2 = R ^ 2 // In this coordinate system, the angular position of the cursor is (r, theta) // The line coming from the center of the circle is y = start.y / start.x * x // The intersection fulfills : x^2 = R^2 / ( 1 + ( start.y / start.x ) ^ 2 ) - tmp = sqrt( sqRadius - / ( ( 1.0 - + mid.y / static_cast( mid.x ) * mid.y - / static_cast( mid.x ) ) ) ); + double tmp = sqrt( sqRadius / + ( ( 1.0 + mid.y / static_cast( mid.x ) * mid.y + / static_cast( mid.x ) ) ) ); // Move to the correct quadrant tmp = mid.x > 0 ? tmp : -tmp; mid.y = mid.y / static_cast( mid.x ) * tmp; @@ -691,31 +688,30 @@ void POINT_EDITOR::updateItem() const double R = v1.EuclideanNorm(); bool transformCircle = false; - bool invertY = ( v2.y < 0 ); /* p2 - * X*** + * X*** * ** <---- This is the arc * y ^ ** * | R * - * | <-----------> * - * x------x------>--------x p1 + * | <-----------> * + * x------x------>--------x p1 * C' <----> C x * delta - * - * p1 does not move, and the tangent at p1 remains the same. + * + * p1 does not move, and the tangent at p1 remains the same. * => The new center, C', will be on the C-p1 axis. * p2 moves - * + * * The radius of the new circle is delta + R - * - * || C' p2 || = || C' P1 || + * + * || C' p2 || = || C' P1 || * is the same as : * ( delta + p2.x ) ^ 2 + p2.y ^ 2 = ( R + delta ) ^ 2 - * + * * delta = ( R^2 - p2.x ^ 2 - p2.y ^2 ) / ( 2 * p2.x - 2 * R ) - * - * We can use this equation for any point p2 with p2.x < R + * + * We can use this equation for any point p2 with p2.x < R */ if( v2.x == R )