[planegcs] Implement calculateAngleViaParams
For use in angle-via-point with complex curves.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user