I appreciate that some might raise their eyebrows at the idea of a polygon being skewed, but I ask for their indulgence while I explain the problem.
The attached image shows the circuit pattern associated with a small airfield, with the runway on the lower of the two long legs (marked with a grey track). The Northeastern approach is offset due to a requirement to avoid overflying certain properties ("avoid" areas marked in red).
I have been attempting to expand the circuit track using software to give me an overlay such as the one I've drawn in manually (yellow), with the intention of being able to identify a "circuit perimeter" within which aircraft should exercise particular caution. Nominally, the perimeter is 500m outside the circuit.
Unfortunately, I seem to have presented myself with a rather thorny problem :-)
The main issue is that due to the (approximate) rectangle being rotated, even if I translate it so that the geographical origin is at its centre two of the corners (marked with a through-line) lie in the "wrong quadrant" with the result that standard graphics operations don't work properly: they move at least one corner in the wrong direction, and/or by a significantly wrong distance.
It might be possible to compensate for that by rotating the circuit pattern before trying to scale it, but as soon as that approach was applied to an airfield with two active runways I'm pretty sure it would go wrong.
There are two approaches I feel might work:
a) Move each line (leg of the circuit) out by 500m along the normal, then (iteratively?) work out a new point of intersection. I feel the latter stage could get hairy, particularly since it would have to accommodate situations where the lines already crossed due to a rentrant point.
b) For each pair of lines, compute the angle between them and move the intersection an appropriate distance. If they met at a right angle this would presumably be Sqrt(2) * 500m, for a rentrant point this would be proportionately smaller... wouldn't have to be exact.
I'm not for the moment attaching what I've been struggling with so far, since I think the "quadrant problem" makes it unusable by definition.
Any thoughts would be appreciated.
MarkMLl