Re: makeLine w/ center coord rather than x1,y1,x2,y2?
Posted by
ctrueden on
Jul 17, 2007; 10:02pm
URL: http://imagej.273.s1.nabble.com/makeLine-w-center-coord-rather-than-x1-y1-x2-y2-tp3698838p3698840.html
Hi Robert,
The center point of the line together with the line length is
insufficient information to draw it -- you are missing the slope.
However, it should be quite to do some quick math (point slope
formula) on center point + slope + length to obtain the (x1,y1) and
(x2,y2) coordinates required to call drawLine.
-Curtis
On 7/17/07, Robert Barton <
[hidden email]> wrote:
> 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.
>