[DUG] Arc's
Judd, Struan (eCargo)
Struan.Judd at chh.co.nz
Wed Jan 19 08:47:36 NZDT 2011
This is purely from my head and so may be very wrong but seems correct.
Anyway, assuming that by center, you mean the centre of the ellipse /
arc id do the following (sorry no code)
I'd calculate the Tangent Vector at the Start and End Points and then
interpolate a set of direction vectors between the two tangents, then
scale the direction vectors and apply to the start point as a set of
movements.
No trig required, I believe.
TTFN,Struan,
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Marshland Engineering
Sent: Tuesday, 18 January 2011 21:03
To: delphi at delphi.org.nz
Subject: [DUG] Arc's
Is there an easy way of drawing an arc ? I have center, start and end
co-ordinates as XY.
>From what I can see, I need to look at least 16 combinations to work out
the perimeter size depending in which quadrant the start and ends are
in.
procedure Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);
Use Arc to draw an elliptically curved line with the current Pen. The
arc traverses the perimeter of an ellipse that is bounded by the points
(X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the
ellipse, counterclockwise, from the starting point to the ending point.
The starting point is defined by the intersection of the ellipse and a
line defined by the center of the ellipse and (X3,Y3). The ending point
is defined by the intersection of the ellipse and a line defined by the
center of the ellipse and (X4, Y4).
DISCLAIMER: This electronic message together with any attachments is
confidential. If you are not the intended recipient, do not copy, disclose or
use the contents in any way. Please also advise us by return e-mail that you
have received the message in error and then please destroy it together with its
attachments. Carter Holt Harvey is not responsible for any changes made to this
message and / or any attachments after sending by Carter Holt Harvey. We use
virus scanning software but exclude all liability for viruses or anything
similar in this email or any attachment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110119/52a47b9a/attachment-0001.html
More information about the Delphi
mailing list