jdarling

20-05-2010, 04:36 PM

I have 3 points, the start (P1), the mid (C) of what would be the ellipse, and the end point (P2). I know that I want to calculate n points along this arc. What is the best way of doing this?

Here is a picture in hopes that it helps:

http://www.eonclash.com/PGD/arc.png

Here is my basic prototype (note, vector elements are floats):

function CalcArc(const vStart, vEnd, vCenter : IVector; const numSteps : LongInt = 10) : TVectorArray;

begin

// What goes here???

end;

// Quick example:

procedure TestCalcArc;

var

arcPoints : TVectorArray;

i : LongInt;

begin

arcPoints := CalcArc(Vector(90, 0), Vector(100, 10), Vector(90, 10));

for i := low(arcPoints) to high(arcPoints) do

writeln(format('Point %d) %f, %f', [i, arcPoints[i].x, , arcPoints[i].y]));

end;

Any help greatly appreciated. I know some place in my collection I have this, but I'll be dogged if I can find it. And searching Google returns results related mainly to calculation surface area, lengths, or all points in an arc :(. Then again, my GoogleFoo isn't very strong.

- Jeremy

Here is a picture in hopes that it helps:

http://www.eonclash.com/PGD/arc.png

Here is my basic prototype (note, vector elements are floats):

function CalcArc(const vStart, vEnd, vCenter : IVector; const numSteps : LongInt = 10) : TVectorArray;

begin

// What goes here???

end;

// Quick example:

procedure TestCalcArc;

var

arcPoints : TVectorArray;

i : LongInt;

begin

arcPoints := CalcArc(Vector(90, 0), Vector(100, 10), Vector(90, 10));

for i := low(arcPoints) to high(arcPoints) do

writeln(format('Point %d) %f, %f', [i, arcPoints[i].x, , arcPoints[i].y]));

end;

Any help greatly appreciated. I know some place in my collection I have this, but I'll be dogged if I can find it. And searching Google returns results related mainly to calculation surface area, lengths, or all points in an arc :(. Then again, my GoogleFoo isn't very strong.

- Jeremy