Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tangents or normals to a path
#7
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.
Reply


Messages In This Thread
Tangents or normals to a path - by Ottia Tuota - 12-19-2020, 04:57 PM
RE: Tangents or normals to a path - by Ofnuts - 12-19-2020, 08:40 PM
RE: Tangents or normals to a path - by denzjos - 12-26-2020, 07:59 AM
RE: Tangents or normals to a path - by Ottia Tuota - 01-10-2021, 03:04 PM
RE: Tangents or normals to a path - by denzjos - 01-10-2021, 04:24 PM

Forum Jump: