Thread Subject:
perpendicular line

Subject: perpendicular line

From: Saiful

Date: 16 Sep, 2009 06:34:03

Message: 1 of 3

Hi,

How can I draw a perpendicular line from the mid-point of another line?

Appreciate your help,

Thanks and regards,
KSI

Subject: perpendicular line

From: Darren Rowland

Date: 16 Sep, 2009 06:59:02

Message: 2 of 3

KSI,
You can adapt the following to your specific needs

x = rand(1,2);
y = rand(1,2);
line(x,y)
% Slope of current line
m = (diff(y)/diff(x));
% Slope of new line
minv = -1/m;
line([mean(x) mean(x)+0.5],[mean(y) mean(y)+0.5*minv],'Color','red')
axis equal

Hth,
Darren

Subject: perpendicular line

From: Jos

Date: 16 Sep, 2009 07:38:02

Message: 3 of 3

"Saiful " <esaiful@gmail.com> wrote in message <h8q0sr$3mr$1@fred.mathworks.com>...
> Hi,
>
> How can I draw a perpendicular line from the mid-point of another line?
>
> Appreciate your help,
>
> Thanks and regards,
> KSI

Google -->
http://www.purplemath.com/modules/midpoint.htm

Jos

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
midpoint formula Sprinceana 16 Sep, 2009 03:45:20
code Darren Rowland 16 Sep, 2009 03:04:03
geometry Saiful 16 Sep, 2009 02:39:04
perpendicular line Saiful 16 Sep, 2009 02:39:03
rssFeed for this Thread

Contact us