type
TMyPoint = record
X, Y:do
uble;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure GetEqualPoint(AStartPoint, AEndPoint, ACenterPoint: TMyPoint;
DivideValue: Integer;
AResult: array of TMyPoint);
{
.O
/|/
/ | /
/ | /
A.___|___.B
C
}
var
tmpRadius, tmpOC, tmpBC:do
uble;
tmpRadians, tmpR1: Extended;
tmpMidpoint, tmpPoint: TMyPoint;
begin
{ 1、先取C点坐标 }
tmpMidpoint.X := (AStartPoint.X + AEndPoint.X) / 2;
tmpMidpoint.Y := (AStartPoint.Y + AEndPoint.Y) / 2;
{ 2、计算夹角弧度 }
tmpOC := Sqrt((ACenterPoint.X - tmpMidpoint.X) * (ACenterPoint.X - tmpMidpoint.X) +
(ACenterPoint.Y - tmpMidpoint.Y) * (ACenterPoint.Y - tmpMidpoint.Y));
tmpBC := Sqrt((AEndPoint.X - tmpMidpoint.X) * (AEndPoint.X - tmpMidpoint.X) +
(AEndPoint.Y - tmpMidpoint.Y) * (AEndPoint.Y - tmpMidpoint.Y));
tmpRadians := 2 * Abs(ArcTan2(tmpBC, tmpOC));
{ 3、等分角度弧度 }
tmpR1 := tmpRadians / DivideValue;
{ 4、计算等分坐标 }
// ... 稍微麻烦,可能需要方程组求解,有时间再写。
end;