[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Draw a line through 2 points
From: |
Sue Stones |
Subject: |
Re: Draw a line through 2 points |
Date: |
Sun, 16 May 2004 15:29:29 +1000 |
User-agent: |
KMail/1.5 |
Thanks a lot everyone for your helpful responses. That gives me a much better
idea of how Octave works.
sue
On Sunday 16 May 2004 12:57 am, Ted Harding wrote:
> On 15-May-04 Sue Stones wrote:
> > How do I draw a line through 2 points. Not just between the points
> > but going off the graph on either side?
> >
> > sue
>
> You can do it by specifying two other points to define a line which
> includes the two given points.
>
> e.g. (adjust t1, t2 to your taste; the values below extend the line
> between p1 and p2 to either side by 10 times the distance between
> p1 and p2):
>
> p1=[x1;y1]; p2=[x2;y2];
> t1=(-10); t2=(+10);
> P1=p1 + t1*(p2-p1) ; P2=p2 + t2*(p2-p1);
>
> Now draw a line from P1 to P2 (when t1=0 and t2=0 you get the original
> points p1 and p2).
>
> Hope this helps,
> Ted.
>
>
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <address@hidden>
> Fax-to-email: +44 (0)870 167 1972
> Date: 15-May-04 Time: 15:57:30
> ------------------------------ XFMail ------------------------------
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------