Path: news.mathworks.com!not-for-mail 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$1@newscl01ah.mathworks.com> References: <kivmba$jnh$1@newscl01ah.mathworks.com> <kj0pkf$o9r$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: www-02-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1364483886 21858 172.30.248.47 (28 Mar 2013 15:18:06 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 28 Mar 2013 15:18:06 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2857710 Xref: news.mathworks.com comp.soft-sys.matlab:792196 "Roger Stafford" wrote in message <kj0pkf$o9r$1@newscl01ah.mathworks.com>... > "K" wrote in message <kivmba$jnh$1@newscl01ah.mathworks.com>... > > 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.