public void scaling() { EditedPointsList2.Clear(); EditedPointsList.Clear(); foreach (var item in points2) { EditedPointsList2.Add(new DataPoint(Math.Round((item.X - Convert.ToDouble(ScaleBasePointX)) * Convert.ToDouble(Scale) + Convert.ToDouble(ScaleBasePointX), 3), Math.Round((item.Y - Convert.ToDouble(ScaleBasePointY)) * Convert.ToDouble(Scale) + Convert.ToDouble(ScaleBasePointY), 3))); } foreach (var item in points) { EditedPointsList.Add(new Points(Math.Round((item.X - Convert.ToDouble(ScaleBasePointX)) * Convert.ToDouble(Scale) + Convert.ToDouble(ScaleBasePointX), 3), Math.Round((item.Y - Convert.ToDouble(ScaleBasePointY)) * Convert.ToDouble(Scale) + Convert.ToDouble(ScaleBasePointY), 3))); } }
public void rotating() { EditedPointsList2.Clear(); EditedPointsList.Clear(); foreach (var item in points2) { EditedPointsList2.Add(new DataPoint(Math.Round((item.X - Convert.ToDouble(RotateBasePointX)) * Math.Cos(Convert.ToDouble(RotateAngle) * Math.PI / 180) - (item.Y - Convert.ToDouble(RotateBasePointY)) * Math.Sin(Convert.ToDouble(RotateAngle) * Math.PI / 180) + Convert.ToDouble(RotateBasePointX), 3), Math.Round((item.X - Convert.ToDouble(RotateBasePointX)) * Math.Sin(Convert.ToDouble(RotateAngle) * Math.PI / 180) + (item.Y - Convert.ToDouble(RotateBasePointY)) * Math.Cos(Convert.ToDouble(RotateAngle) * Math.PI / 180) + Convert.ToDouble(RotateBasePointY), 3))); } foreach (var item in points) { EditedPointsList.Add(new Points(Math.Round((item.X - Convert.ToDouble(RotateBasePointX)) * Math.Cos(Convert.ToDouble(RotateAngle) * Math.PI / 180) - (item.Y - Convert.ToDouble(RotateBasePointY)) * Math.Sin(Convert.ToDouble(RotateAngle) * Math.PI / 180) + Convert.ToDouble(RotateBasePointX), 3), Math.Round((item.X - Convert.ToDouble(RotateBasePointX)) * Math.Sin(Convert.ToDouble(RotateAngle) * Math.PI / 180) + (item.Y - Convert.ToDouble(RotateBasePointY)) * Math.Cos(Convert.ToDouble(RotateAngle) * Math.PI / 180) + Convert.ToDouble(RotateBasePointY), 3))); } }
public void UpdatePlot(ObservableCollection <Points> PointsList) { PointsList2.Clear(); foreach (var item in PointsList) { PointsList2.Add(new DataPoint(item.X, item.Y)); } PointsList2.Add(new DataPoint(PointsList[0].X, PointsList[0].Y)); EditedPointsList.Clear(); foreach (var item in PointsList) { EditedPointsList.Add(new Points(item.X, item.Y)); } }
public void translating() { EditedPointsList2.Clear(); EditedPointsList.Clear(); foreach (var item in points2) { EditedPointsList2.Add(new DataPoint(Math.Round(item.X + Convert.ToDouble(TranslateX), 3), Math.Round(item.Y + Convert.ToDouble(TranslateY), 3))); } foreach (var item in points) { EditedPointsList.Add(new Points(Math.Round(item.X + Convert.ToDouble(TranslateX), 3), Math.Round(item.Y + Convert.ToDouble(TranslateY), 3))); } }