Re: Polygon coordinates transformation
- Posted by "Juergen Luethje" <j.lue at gmx.de> Mar 18, 2004
- 355 views
Tommy wrote: > Juergen wrote: >> I don't think that this is the case. I think in your equations: >> x1 * a + y1 * b + c = u1 >> x2 * a + y2 * b + c = u2 >> x3 * a + y3 * b + c = u3 >> x4 * a + y4 * b + c = u4 >> >> the variables u? (belonging to the source polygon) are known, but the >> variables x? and y? (belonging to the destination polygon) are *not* >> known. If you knew the values of the variables x? and y?, you were >> already done, and it wouldn't be necessary to do any calculation ... >> And what about the variables a, b, and c? I'm not sure whether or not >> you know them, because I don't know their meaning. > > (x?, y?) are the 4 coordinates of the corners of the polygon, so those are > known. I'm trying to find a, b and c. > >> Assumption: >> You want to be able to change the *size* of any polygon with 4 corners, >> without changing its shape, i.e. without altering any of its *angles*. >> Is this true? > > No, it's not. Oops. Then I misunderstood your original post, sorry. > I have 2 polygons that don't need to be of the same shape. > Polygon 1 has coordinates {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}} and > polygon 2 has coordinates {{u1, v1}, {u2, v2}, {u3, v3}, {u3, v3}}. If I > take a random point that is part of polygon 1, I need to find the > corresponding point in polygon 2. It sounds to me, as if this problem can't be solved, because it's not defined exactly. In your original post, you wrote: | I need to find a formula that transforms a coordinate {x, y} inside | polygon_destination to a coordinate {u, v} inside polygon_source. But you didn't specify, what kind of transformation you want to do. Also, if you have two quadrilaterals with different shapes, say a trapezoid ( http://mathworld.wolfram.com/Trapezoid.html ) and a kite ( http://mathworld.wolfram.com/Kite.html ), and then you take a random point of the trapezoid, what do you mean by "corresponding point" in the kite? Regards, Juergen