From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Parallel to line through point without slope calculation
Date: Thu, 28 Mar 2013 15:18:06 +0000 (UTC)
Organization: University of Toronto
Lines: 15
Message-ID: <kj1mve$lb2$>
References: <kivmba$jnh$> <kj0pkf$o9r$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1364483886 21858 (28 Mar 2013 15:18:06 GMT)
NNTP-Posting-Date: Thu, 28 Mar 2013 15:18:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2857710
Xref: comp.soft-sys.matlab:792196

"Roger Stafford" wrote in message <kj0pkf$o9r$>...
> "K" wrote in message <kivmba$jnh$>...
> > I have two points (a,b) that make up a line, and a third point (c). I'd like to draw a line (length x) that is parallel to (a,b) but passes through c (at its midpoint).
> - - - - - - - - -
>   Let a, b, and c be vectors of the three given points, each consisting of their respective cartesian coordinates.  The two vectors, d and e, of the endpoints of the desired line segment parallel to the line through a and b with c as its midpoint and of length x can be calculated as follows:
>  t = x/2*(b-a)/norm(b-a);
>  d = c + t;
>  e = c - t;
> No slope computation is involved.
> Roger Stafford

This is magnificent! Thank you so very much, Mr. Stafford.