Edge perpendicular to line.

View: New views
5 Messages — Rating Filter:   Alert me  

Edge perpendicular to line.

by Paulo J. Matos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have two nodes (n1 and n2) with an edge (e1) between then.
Now I have a third node (n3) and I would like to have an edge (e2)
from node n3 to the edge e1, such that e2 is perpendicular to e1. Is
there any way to do this automatically, without precomputing ?

Thanks,

--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Edge perpendicular to line.

by Rouben Rostamian-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Oct 25, 2009 at 02:42:57PM +0000, Paulo J. Matos wrote:
>
> I have two nodes (n1 and n2) with an edge (e1) between then.
> Now I have a third node (n3) and I would like to have an edge (e2)
> from node n3 to the edge e1, such that e2 is perpendicular to e1. Is
> there any way to do this automatically, without precomputing ?

Will this do?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
   \tikzstyle{mynode}=[draw=black, minimum width=2cm, minimum height=1cm]
   \node[mynode] (A) at (0,0) {Node A};
   \node[mynode] (B) at (6,0) {Node B};
   \node[mynode] (C) at (4,3) {Node C};
   \draw (A.east) -- (B.west);
   \draw (A.east) -| (C.south);
\end{tikzpicture}
\end{document}

--
Rouben Rostamian

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Edge perpendicular to line.

by Paulo J. Matos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2009-10-25 at 11:59 -0400, Rouben Rostamian wrote:

> On Sun, Oct 25, 2009 at 02:42:57PM +0000, Paulo J. Matos wrote:
> >
> > I have two nodes (n1 and n2) with an edge (e1) between then.
> > Now I have a third node (n3) and I would like to have an edge (e2)
> > from node n3 to the edge e1, such that e2 is perpendicular to e1. Is
> > there any way to do this automatically, without precomputing ?
>
> Will this do?
>
> \documentclass{article}
> \usepackage{tikz}
> \begin{document}
> \begin{tikzpicture}
>    \tikzstyle{mynode}=[draw=black, minimum width=2cm, minimum height=1cm]
>    \node[mynode] (A) at (0,0) {Node A};
>    \node[mynode] (B) at (6,0) {Node B};
>    \node[mynode] (C) at (4,3) {Node C};
>    \draw (A.east) -- (B.west);
>    \draw (A.east) -| (C.south);
> \end{tikzpicture}
> \end{document}
>

Not really. This is maybe an ugly hack but not a solution and it would
work on my case that I have the connection from A to B decorated with
snake.

What I want is something line:
               A
               ^
               |
               |
C ------------>|
               |
               B

Unfortunately the point that C is pointing to is not the mid point of
B->A. I really need to say. I want to point from C to the point between
B->A that makes the edge from C perpendicular to B->A.
--
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.pmatos.net


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Edge perpendicular to line.

by Bugzilla from avatar@hot.ee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> What I want is something line:
>                A
>                ^
>                |
>                |
> C ------------>|
>                |
>                B
>

  Did you look at projection modifiers - 12.4.5 in the PGF manual?

Misha

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Edge perpendicular to line.

by Mark Wibrow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Try using the perpendicular path specification in the coordinate, e.g.,

\draw (C) -- (C -| A);

Mark

2009/10/25 Paulo J. Matos <pocmatos@...>:

> On Sun, 2009-10-25 at 11:59 -0400, Rouben Rostamian wrote:
>> On Sun, Oct 25, 2009 at 02:42:57PM +0000, Paulo J. Matos wrote:
>> >
>> > I have two nodes (n1 and n2) with an edge (e1) between then.
>> > Now I have a third node (n3) and I would like to have an edge (e2)
>> > from node n3 to the edge e1, such that e2 is perpendicular to e1. Is
>> > there any way to do this automatically, without precomputing ?
>>
>> Will this do?
>>
>> \documentclass{article}
>> \usepackage{tikz}
>> \begin{document}
>> \begin{tikzpicture}
>>    \tikzstyle{mynode}=[draw=black, minimum width=2cm, minimum height=1cm]
>>    \node[mynode] (A) at (0,0) {Node A};
>>    \node[mynode] (B) at (6,0) {Node B};
>>    \node[mynode] (C) at (4,3) {Node C};
>>    \draw (A.east) -- (B.west);
>>    \draw (A.east) -| (C.south);
>> \end{tikzpicture}
>> \end{document}
>>
>
> Not really. This is maybe an ugly hack but not a solution and it would
> work on my case that I have the connection from A to B decorated with
> snake.
>
> What I want is something line:
>               A
>               ^
>               |
>               |
> C ------------>|
>               |
>               B
>
> Unfortunately the point that C is pointing to is not the mid point of
> B->A. I really need to say. I want to point from C to the point between
> B->A that makes the edge from C perpendicular to B->A.
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.pmatos.net
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users