54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WaferAdjust
|
|
{
|
|
internal class TranslateCirclePoint
|
|
{
|
|
private double rotateX;
|
|
private double rotateY;
|
|
List<PointInfo> totalPoints;
|
|
List<PointInfo> totalCenters;
|
|
private int circleIndex;
|
|
private double perAngle;
|
|
public void SetRotateXY(double x, double y, double angle)
|
|
{
|
|
rotateX = x; rotateY = y;
|
|
totalPoints = new List<PointInfo>();
|
|
totalCenters = new List<PointInfo>();
|
|
circleIndex = 0;
|
|
perAngle = angle;
|
|
}
|
|
public void AddCirclePoint(List<PointInfo> pointInfos)
|
|
{
|
|
foreach (var item in pointInfos)
|
|
{
|
|
totalPoints.Add(new PointInfo(item.X, item.Y, circleIndex * perAngle));
|
|
}
|
|
}
|
|
public void AddCircleIndex()
|
|
{
|
|
circleIndex++;
|
|
}
|
|
public void AddCircleCenter(double x, double y, double r)
|
|
{
|
|
totalCenters.Add(new PointInfo(x, y, r));
|
|
}
|
|
public List<PointInfo> DoTranslatePoint()
|
|
{
|
|
List<PointInfo> trans = new List<PointInfo>();
|
|
foreach (var item in totalPoints)
|
|
{
|
|
var res = Rotation2D.GetOriginalPointDegrees(item.X, item.Y,
|
|
rotateX, rotateY, item.Radius, true, false);
|
|
Console.WriteLine($"{item.X} {item.Y} {item.Radius} ==> {res.x} {res.y}");
|
|
trans.Add(new PointInfo(res.x, res.y, item.Radius));
|
|
}
|
|
return trans;
|
|
}
|
|
}
|
|
}
|