Exemple #1
0
 public static Shape2 Mirror(this Shape2 shape, Vector2 center)
 {
     return(shape.Transform(p => p - 2 * (p - center)));
 }
Exemple #2
0
 public static Shape2 Move(this Shape2 shape, Vector2 move)
 {
     return(shape.Transform(p => p + move));
 }
Exemple #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());
        }
Exemple #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)));
        }
Exemple #5
0
        public static Shape2 Rotate(this Shape2 shape, double angle)
        {
            var m = Rotates2.Rotate(angle);

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