01-10-2021, 03:04 PM
(This post was last modified: 01-11-2021, 09:03 AM by rich2005.
Edit Reason: fixed url
)
The package got a new addition: a plugin called "Common tangent or normal between two paths". You get it from
http://kmarkku.arkku.net/Path_tangents_f...aster.html
as before.
The new plugin tries to draw a common tangent of two paths. Or a common normal. Or a line segment which is a tangent to one of the paths and a normal to the other path. A picture:
The path is the right-clicked path, and the other path is inputted in the GUI of the plugin. You give a tentative tangent (a line segment) where you think the tangent should be, and the plugin tries to snap it to be a real tangent.
In the next picture on the left, the plugin has drawn a common normal between the two paths. You make first a tentative common normal and so on. On the right you see a line segment that is a tangent of the path and a normal of the other path.
I don't guarantee that the plugin works well in all cases. It differs from the others in the package. Instead of solving an equation, the plugin does an iterative search. It is crucial that the tentative tangent is rather accurate (it gives the starting point for the iteration). If you find some difficult cases, please tell.
In case you are interested: The idea in the implementation is to iterate, and at each iteration step to try to solve the (hard) pair of equations involved. But that pair of equations cannot be solved exactly, so what is solved is its linear approximation. Then the solution is far from exact, hence the iteration, hoping it to converge towards the exact solution. In the few cases I have tried the plugin has worked well. But as I said, I don't guarantee anything.
And there is one fact that is not really worth mentioning but here goes. The problem is: what to do when the tangent or normal to be drawn is of zero length? Normally the plugin draws the tangents or normals between two points that are well separated. But it may happen that the two paths have a common tangent (or normal) at a point where they meet; in other words, they meet tangentially (or perpendically). Then the plugin should draw a line segment of zero length. I don't really know what would be a good way to handle such cases. But currently the plugin treats such cases in an exceptional way: instead of a zero length line segment it draws it to have the same length as the tentative tangent (normal). I am not happy with this, to make the plugin to switch to exceptional behaviour in such special cases that are very rare in practice. And I believe that if the user knows how to create two paths meeting precisely tangentially (or perpendically), (s)he probably also knows how to draw the common tangent (normal) without any plugins.
But here is an example:
On the left the paths (two parabolas) meet tangentially and the plugin has found and drawn the common tangent. On the right two parabolas meet perpendically, and the plugin has drawn a common tangent-normal.
http://kmarkku.arkku.net/Path_tangents_f...aster.html
as before.
The new plugin tries to draw a common tangent of two paths. Or a common normal. Or a line segment which is a tangent to one of the paths and a normal to the other path. A picture:
The path is the right-clicked path, and the other path is inputted in the GUI of the plugin. You give a tentative tangent (a line segment) where you think the tangent should be, and the plugin tries to snap it to be a real tangent.
In the next picture on the left, the plugin has drawn a common normal between the two paths. You make first a tentative common normal and so on. On the right you see a line segment that is a tangent of the path and a normal of the other path.
I don't guarantee that the plugin works well in all cases. It differs from the others in the package. Instead of solving an equation, the plugin does an iterative search. It is crucial that the tentative tangent is rather accurate (it gives the starting point for the iteration). If you find some difficult cases, please tell.
In case you are interested: The idea in the implementation is to iterate, and at each iteration step to try to solve the (hard) pair of equations involved. But that pair of equations cannot be solved exactly, so what is solved is its linear approximation. Then the solution is far from exact, hence the iteration, hoping it to converge towards the exact solution. In the few cases I have tried the plugin has worked well. But as I said, I don't guarantee anything.
And there is one fact that is not really worth mentioning but here goes. The problem is: what to do when the tangent or normal to be drawn is of zero length? Normally the plugin draws the tangents or normals between two points that are well separated. But it may happen that the two paths have a common tangent (or normal) at a point where they meet; in other words, they meet tangentially (or perpendically). Then the plugin should draw a line segment of zero length. I don't really know what would be a good way to handle such cases. But currently the plugin treats such cases in an exceptional way: instead of a zero length line segment it draws it to have the same length as the tentative tangent (normal). I am not happy with this, to make the plugin to switch to exceptional behaviour in such special cases that are very rare in practice. And I believe that if the user knows how to create two paths meeting precisely tangentially (or perpendically), (s)he probably also knows how to draw the common tangent (normal) without any plugins.
But here is an example:
On the left the paths (two parabolas) meet tangentially and the plugin has found and drawn the common tangent. On the right two parabolas meet perpendically, and the plugin has drawn a common tangent-normal.