public void rotatePoint(SegmentPoint inPoint, SegmentPoint center, double angRad) { rotate2D(inPoint - center, angRad); this.X = this.X + center.X; this.Y = this.Y + center.Y; }
private void rotate2D(SegmentPoint inPoint, double angRad) { //CW rotation this.X = (double)(Math.Cos(angRad) * inPoint.X - Math.Sin(angRad) * inPoint.Y); this.Y = (double)(Math.Sin(angRad) * inPoint.X + Math.Cos(angRad) * inPoint.Y); }