hello
How should I proceed to build the opposite (image) of a polygone (object) with respect to a line?
hello
How should I proceed to build the opposite (image) of a polygone (object) with respect to a line?
I would use the Affiner transformer.
If I understand the math correctly the parameters should be
A: (1-m^2)/(1+m^2)
B: 2m/(1+m^2)
C: -2mb/(1+m^2)
D: 2m/(1+m^2)
E: (m^2-1)/(1+m^2)
F: 2b/(1+m^2)
for the line y = mx +b
If the line is the y-axis it simplifies to -1 0 0 0 1 0
If the line is the x-axis it simplies to 1 0 0 0 -1 0
I would use the Affiner transformer.
If I understand the math correctly the parameters should be
A: (1-m^2)/(1+m^2)
B: 2m/(1+m^2)
C: -2mb/(1+m^2)
D: 2m/(1+m^2)
E: (m^2-1)/(1+m^2)
F: 2b/(1+m^2)
for the line y = mx +b
If the line is the y-axis it simplifies to -1 0 0 0 1 0
If the line is the x-axis it simplies to 1 0 0 0 -1 0
Hello @jdh
It is a line from an FME perspective (i.e. with multiple vertices) not from a math perspective.
It wouldn't be possible to describve the line with an equation like y =mx +b
Hello @jdh
It is a line from an FME perspective (i.e. with multiple vertices) not from a math perspective.
It wouldn't be possible to describve the line with an equation like y =mx +b
If it's a straight line then you can calculate it easily enough by taking the coordinates of the starting vertex and ending vertex.
There's not enough caffeine in the world for me to figure out a reflection for a curve.
If it's a straight line then you can calculate it easily enough by taking the coordinates of the starting vertex and ending vertex.
There's not enough caffeine in the world for me to figure out a reflection for a curve.
@jdh unfortunately, it is not a straigth line.
@takashi Any ideas?
@jdh unfortunately, it is not a straigth line.
@takashi Any ideas?
Could you illustrate how the feature would reflect across a non-straight line? It would think it could cause significant distortion in the feature.
You would probably need to reflect each vertex independently and then rebuild your polygon.
It would be something like
@jdh unfortunately, it is not a straigth line.
@takashi Any ideas?
I think you first have decide what simplification could be applied to the mirror lines and what is appropriate for the result you want. Do your lines have arcs? Can you use a chopper by 2 and then use a neighborfinder to reflect on the nearest segment? Or is a generalizer more appropriate? Does a single line function as a mirror for more than one polygon or is it one by one. Do they share a common value? No straight forward solution. It will get messy in some places I guess.
@jdh unfortunately, it is not a straigth line.
@takashi Any ideas?
I cannot imagine how a shape should be transformed if the line isn't straight. Could you please illustrate specifically how a triangle should be transformed if the line is S-shape, for example?
@takashi
It is possible to do that, though the calculation is much more difficult (often very much so ).
Also it would be a stretch to call the result a "reflection". It would be more like a laughing mirror reflection.
You end up with distortions up to extremes.
Depending on the curve and weather it can be described as a single function.
I don't see any apparent use for such in Geography.
I'm wondering if @arthy is talking polylines. Which are still lines.
Reflecting in segments of polylines raises the question as what you consider a reflection even.
AS you can reflect anything in any line.
So reflecting in a polyline might also be considered as reflecting in any line segment of the polyline.
So where do you set your bounds?
@takashi
@arthy
Of course a question been posed many a time and solutions abound.
https://www.reddit.com/r/math/comments/4xrpjk/how_to_define_a_nonlinear_reflection_in_2d/
Check the links, you'll love it. The Imgur gifts.
Thanks @jdh, @gio, @pratsch
Based on your comments/answers, this is What I did to obtained an "approximate solution":
This is an illustration where the part of the feature contained in a specific small right rectangle was reflected in the corresponding small left rectangle.
Thanks @jdh, @gio, @pratsch
Based on your comments/answers, this is What I did to obtained an "approximate solution":
This is an illustration where the part of the feature contained in a specific small right rectangle was reflected in the corresponding small left rectangle.
Looks like reflection in a line. If the line is not "straight" it looks like a polyline.
I see no curves, arcs etc. (also you can always stroke a non line)
If all or some of the lines of the polyline have different angles, then you are warping your object. Or in your example, as they are point objects, displacing geographic features. (lidar samples or something)
And you seem to reflect in the line(segment) closest to the objects.
Looks visibly warped.
Why would you want to do that to geo features?
The reflection question has been posted on this forum before by the way.
Looks like reflection in a line. If the line is not "straight" it looks like a polyline.
I see no curves, arcs etc. (also you can always stroke a non line)
If all or some of the lines of the polyline have different angles, then you are warping your object. Or in your example, as they are point objects, displacing geographic features. (lidar samples or something)
And you seem to reflect in the line(segment) closest to the objects.
Looks visibly warped.
Why would you want to do that to geo features?
The reflection question has been posted on this forum before by the way.
@gio,
On the screen shot, I zoommed in a lot just to illustrate the methodology. There are some cases where the reflection has to be done on a line having an arc shape or an S-shape.
I'm not reflecting to the closest object. I used the small rectangles to split the object and it is only the part included in that small rectangle that will be reflected. In the previous image, I only show the part of the object that was included in one of those small rectangles.
I'm going to use the reflected objects in combination with the original objects to create a worst case scenario of possible obstruction of any structure over or beside a railway track.