degrees( azimuth( $geometry, closest_point( aggregate( 'lotto', 'collect', $geometry, intersects($geometry, $geometry) ), $geometry ) ) )
However the symbology of points 1, 2, 6, 7 is correct, while that of points 3, 4, 5 is not, as the calculated rotation value is 0.
How can I also make points 3, 4, 5 perpendicular to the various segments? is it possible by modifying this expression or do I have to use another approach.
The layers in question are two different, a point layer and a polygonal one.