For example: how do show the angles of a triangle?
My answer below isn’t about intersecting lines, but about triangles and more general polygons.
The question is inconsistent insofar as both cases require very different approaches. This mainly concerning the ways how to pass the object / objects to the routine. .
The applicable mathematical methods are the same, of course.
Note: The LO Draw is not a CAD software.
My first tip:
You can write a macro to calculate (and display) the angle between two selected lines based on their position and size values by the well known trigonometry equations.
Or there is a more simplier way for the calculation: calculate the difference of the angles based on the “absolute” angle values of the two lines…
(Note: the actual angle value will be rotated by 180° when you interchange the Start and End points of a line.)
And an another tip:
Try the CADLO extension. Maybe that has some similar improved function…
Here is an another example macro to calculate the angles of two lines and the difference. Maybe the sample code with two line object only will be simpler to understand.
Of course, @Ziyi64 is right.
However, I don’t know CADLO yet on the one hand, and on the other hand I considered related tasks a few years ago.
Therefore I made a little demo showing how user code might help with the current question.
Of course, it can handle any polygon independent of the number of vertices. Since the angles are calculated based on the scalar products of adjacent edges (the respective vectors to be more precise) and scalar products are insensitive concerning the orientation of angles, reflex angles are not recognized.
If you need reflex angles or any results related to angle orientation, I would recommend to handle everything by calculations using complex numbers as their theoretical background.
Thanks to Lupp and Ziz64 for your responses.
I have installed the CADLO extension.
This enables me to measure and display the angle between two adjacent lines. It works for two intersecting lines and for polygons.
The lines or polygons do not have to be drawn using CADLO they can be drawn using the standard LO Drawing Toolbar.