[planegcs] Implement calculateAngleViaParams

For use in angle-via-point with complex curves.
This commit is contained in:
Ajinkya Dahale
2024-02-08 19:47:41 +05:30
parent c3e6f58b90
commit 0dd55072dc
2 changed files with 14 additions and 0 deletions

View File

@@ -1679,6 +1679,16 @@ System::calculateAngleViaPoint(const Curve& crv1, const Curve& crv2, Point& p1,
return atan2(-n2.x * n1.y + n2.y * n1.x, n2.x * n1.x + n2.y * n1.y);
}
double System::calculateAngleViaParams(const Curve& crv1,
const Curve& crv2,
double* param1,
double* param2) const
{
GCS::DeriVector2 n1 = crv1.CalculateNormal(param1);
GCS::DeriVector2 n2 = crv2.CalculateNormal(param2);
return atan2(-n2.x * n1.y + n2.y * n1.x, n2.x * n1.x + n2.y * n1.y);
}
void System::calculateNormalAtPoint(const Curve& crv,
const Point& p,
double& rtnX,

View File

@@ -501,6 +501,10 @@ public:
double calculateAngleViaPoint(const Curve& crv1, const Curve& crv2, Point& p) const;
double calculateAngleViaPoint(const Curve& crv1, const Curve& crv2, Point& p1, Point& p2) const;
double calculateAngleViaParams(const Curve& crv1,
const Curve& crv2,
double* param1,
double* param2) const;
void calculateNormalAtPoint(const Curve& crv, const Point& p, double& rtnX, double& rtnY) const;
// Calculates errors of all constraints which have a tag equal to