public Box(Point center) : base(Physics.Material.Wood, new Point(0, 0), false, null) { type = random.Next(0, 3); Point v = new Point(Size / 2, Size / 2); var points = new[] { center + v, center + v.RotateAroundOrigin(Math.PI / 2), center - v, center - v.RotateAroundOrigin(Math.PI / 2) }; Shape = new ConvexPolygon(points); }
public IceWall(Point center, double width, double height) : base(Physics.Material.Ice, new Point(0, 0), true, null) { this.width = width; this.height = height; Point v = new Point(width / 2, height / 2); var points = new[] { center + v, center + v.RotateAroundOrigin(Math.PI / 2), center - v, center - v.RotateAroundOrigin(Math.PI / 2) }; Shape = new ConvexPolygon(points); }
public Ground(Point center, double width, double height) : base(Physics.Material.Grass, new Point(0, 0), true, null) { type = random.Next(3); this.width = width; this.height = height; var v = new Point(width / 2, height / 2); var points = new[] { center + v, center + v.RotateAroundOrigin(Math.PI / 2), center - v, center - v.RotateAroundOrigin(Math.PI / 2) }; Shape = new ConvexPolygon(points); }
public Segment RotateAroundOrigin(double angle) { return(new Segment(A.RotateAroundOrigin(angle), B.RotateAroundOrigin(angle))); }
public Point RotateAroundPoint(Point center, double angle) { Point v = this - center; return(center + v.RotateAroundOrigin(angle)); }
public Line RotateAroundOrigin(double angle) { return(new Line(A.RotateAroundOrigin(angle), B.RotateAroundOrigin(angle))); }