I need to draw kind of parallel line based on the original one like this.
I use this code
const int shift = 10;
PointF[] clonedPoints = new PointF[polygon.Count];
float dx = polygon[1].X - polygon[0].X;
float dy = polygon[1].Y - polygon[0].Y;
for (int i = 0; i < polygon.Count; i++)
{
var k = (float)Math.Atan2(dx / 100, dy / 100);
float x = polygon[i].X + k + shift;
float y = polygon[i].Y + k + shift;
clonedPoints[i] = new PointF(x, y);
}
And I get lines like this.
The blue is the cloned one.
So I tried to play with some koefficient k
and shift
but it does not help.