예제 #1
0
 public static Shape2 Mirror(this Shape2 shape, Vector2 center)
 {
     return(shape.Transform(p => p - 2 * (p - center)));
 }
예제 #2
0
 public static Shape2 Move(this Shape2 shape, Vector2 move)
 {
     return(shape.Transform(p => p + move));
 }
예제 #3
0
        public static Shape2 Mirror(this Shape2 shape, Line2 line)
        {
            var n = line.Normal;

            return(shape.Transform(p => p - 2 * line.Fn(p) * n / line.Normal.Len2).Reverse());
        }
예제 #4
0
        public static Shape2 Rotate(this Shape2 shape, Vector2 center, double angle)
        {
            var m = Rotates2.Rotate(angle);

            return(shape.Transform(p => center + m * (p - center)));
        }
예제 #5
0
        public static Shape2 Rotate(this Shape2 shape, double angle)
        {
            var m = Rotates2.Rotate(angle);

            return(shape.Transform(p => m * p));
        }
예제 #6
0
 public static Shape2 Mult(this Shape2 shape, double k)
 {
     return(shape.Transform(p => p * k));
 }
예제 #7
0
 public static Shape2 Scale(this Shape2 shape, Vector2 aSize, Vector2 bSize)
 {
     return(shape.Transform(p => p.Scale(aSize, bSize)));
 }