public static PolyLine Stroke(double x1, double y1, double x2, double y2, double w) { PolyLine PL = new PolyLine(PolyIDs.GFXTemp); PointD A = new PointD(x1, y1); PointD B = new PointD(x2, y2); var C = B - A; PL.MakeRectangle(w, C.Length() + w); PL.Translate(0, C.Length() / 2); PL.RotateDegrees(Math.Atan2(C.Y, C.X) * 360 / (Math.PI * 2) - 90); PL.Translate(x1, y1); return(PL); }
internal void SetRotatedRectangle(double Width, double Height, double Rotation, double Xoff, double Yoff) { Shape.Vertices.Clear(); Shape.MakeRectangle(Width, Height); Shape.Translate(Xoff, Yoff); Shape.RotateDegrees(Rotation); }