Hi Robert,
You would also have to specify an angle, because just the center point
and the length will not define a unique line. If you specify these four
parameters : the center, the length and an angle (relative to a
reference), you can easily use them to compute the four coordinates of
the end points.
A : the angle relative to the horizontal direction
x0, y0 : coordinates of the center
L : length of the segment
then the coordinates of the end points (x1,y1 and x2,y2) are
x1 = x0-0.5*L*cosA
y1 = y0-0.5*L*sinA
x2 = x0+0.5*L*cosA
y2 = y2+0.5*L*sinA
or something like that ;)
Cheers
Christophe
Christophe
Robert Barton a écrit :
> Hi everyone,
>
> I'm guessing this will be a quick "No", but I figured I'd try asking
> anyways...
>
> When writing a macro, is it possible to draw a line based upon the center
> point of that line? IOW, rather than using makeLine(156,197,356,197),
> could I create a line by specifying the center point (256,197 in this case)
> and then specifying how long the line should be?
>
> Thanks.
>