Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\dots along matrix diagonal?

1,267 views
Skip to first unread message

Olivier Lefevre

unread,
Apr 30, 1996, 3:00:00 AM4/30/96
to tech-s...@math.ams.org

The subject header says it all: I want to draw a tridiagonal matrix,
with just the first and last two lines filled out and 3 lines of dots
racing along the diagonal. I hoped the AMSLaTeX package would have
something about this but I can't find anything. Could anybody supply
example code? I have seen such matrices in books that were obvioulsy
produced using TeX, so it can be done. I just don't know how.

Thanks <a lot> in advance !

Olivier Lefevre
Union Bank of Switzerland
New York, NY

Lachlan McFetridge

unread,
May 3, 1996, 3:00:00 AM5/3/96
to

Olivier Lefevre wrote:
>
> The subject header says it all: I want to draw a tridiagonal matrix,
> with just the first and last two lines filled out and 3 lines of dots
> racing along the diagonal. I hoped the AMSLaTeX package would have
> something about this but I can't find anything. Could anybody supply
> example code? I have seen such matrices in books that were obvioulsy
> produced using TeX, so it can be done. I just don't know how.

Do you mean one of these . .
. \ddots . \vdots ... \ldots
. .

Lachlan.

Petri Kaurinkoski

unread,
May 3, 1996, 3:00:00 AM5/3/96
to nny...@ny.ubs.com

Use \ddots. Here is an example (not beautiful, but anyway)

$$
\pmatrix{ c & -a & 0 & & \dots & 0 \cr
-b & c & -a & & & \cr
0 & -b & c & -a & \ddots & \vdots \cr
\vdots & \ddots & & \ddots & & \cr
& & & -b & c & -a \cr
0 & \dots & & 0 & -b & c \cr}
$$

Regards,

Petri

--

-------------------------------------------------------------------------
Petri Kaurinkoski Petri.Ka...@hut.fi
Helsinki University of Technology Tel. + 358-0-451 3461
Laboratory of Aerodynamics Telefax + 358-0-451 3418
S{hk|miehentie 4, FIN-02150, FINLAND Telex 125161 htkk sf
http://www.aero.hut.fi/~kaurinko/
-------------------------------------------------------------------------


Martin Volwerk

unread,
May 3, 1996, 3:00:00 AM5/3/96
to

In article <31897F...@eng.monash.edu.au>, Lachlan McFetridge

I think it might be easiest just to write:

\begin{array}
bla & bla & bla & bla & bla \\
& . & & & \\
& & . & & \\
& & & . & \\
bla & bla & bla & bla & bla
\end{array}

takes less time than searching all the info, you could even use \cdot I
guess
instead of .

Goodluck
Martin.
--

____ ____
THE TRUTH IS OUT THERE _ __^ ^__ _
\\(o)(o)//
Martin Volwerk \\ //
Lunar and Planetary Laboratory \\ //
901 Gould-Simpson Bldg | Univ. of Arizona \\//
Tucson, AZ 85721, USA XX
phone: (+1)-(520)-626-5121 (office) //\\
(+1)-(520)-621-4493 (comp. room) // \\
url: http://vega.lpl.arizona.edu/~volwerk // \\
_//_ _\\_
THE OWLS ARE NOT WHAT THEY SEEM ____ ____

Tom Scavo

unread,
May 5, 1996, 3:00:00 AM5/5/96
to

In article <4mc7rg$m...@ankka.csc.fi>,

Petri Kaurinkoski <Petri.Ka...@hut.fi> wrote:
>
>$$
>\pmatrix{ c & -a & 0 & & \dots & 0 \cr
> -b & c & -a & & & \cr
> 0 & -b & c & -a & \ddots & \vdots \cr
> \vdots & \ddots & & \ddots & & \cr
> & & & -b & c & -a \cr
> 0 & \dots & & 0 & -b & c \cr}
>$$

Very nice (Plain TeX) example. Here's a corresponding AMS-LaTeX
solution (which the original poster asked about):

\usepackage{amsmath}
...
\begin{equation*}
\begin{pmatrix}
c & -a & 0 & \dots & \dots & \dots & 0 \\
-b & c & -a & \ddots & & & \vdots \\
0 & -b & c & \ddots & \ddots & & \vdots \\
\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
\vdots & & \ddots & \ddots & c & -a & 0 \\
\vdots & & & \ddots & -b & c & -a \\
0 & \dots & \dots & \dots & 0 & -b & c
\end{pmatrix}
\end{equation*}

(Note: since amsmath.sty redefines \pmatrix, the first example
will not work with AMS-LaTeX.) You can get rid of some of the
dots if you think the matrix looks too "busy". You could use
\hdotsfor to consolidate consecutive \dots commands, but there
are no corresponding commands for \ddots and \vdots AFAIK, so
the result wouldn't look very good.

Cheers,
--
Tom Scavo
mailto:trs...@syr.edu
http://web.syr.edu/~trscavo/

Spencer Muse

unread,
May 6, 1996, 3:00:00 AM5/6/96
to

> \usepackage{amsmath}
> ...
> \begin{equation*}
> \begin{pmatrix}
> c & -a & 0 & \dots & \dots & \dots & 0 \\
> -b & c & -a & \ddots & & & \vdots \\
> 0 & -b & c & \ddots & \ddots & & \vdots \\
> \vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
> \vdots & & \ddots & \ddots & c & -a & 0 \\
> \vdots & & & \ddots & -b & c & -a \\
> 0 & \dots & \dots & \dots & 0 & -b & c
> \end{pmatrix}
> \end{equation*}
>

But look at what happens when some of the columns have different widths:
for example, change the c's above to x+c. Then you get a bunch of
unaligned dots. Is there a simple way to consider the geometry of the
matrix before assigning angles for the dots?


----------------------------------------------------------------------
Spencer V. Muse | (814)863-7045
Institute of Molecular Evolutionary Genetics, | mu...@kurtz.bio.psu.edu
Department of Biology |
Penn State University | FAX: (814)865-9131
University Park PA 16802-5301 |
-----------------------------------------------------------------------

Olivier Lefevre

unread,
May 10, 1996, 3:00:00 AM5/10/96
to

Spencer Muse wrote:

> But look at what happens when some of the columns have different widths:
> for example, change the c's above to x+c. Then you get a bunch of
> unaligned dots. Is there a simple way to consider the geometry of the
> matrix before assigning angles for the dots?

Yes, after experimenting with the examples posted, I came to the same
conclusion. What we need is the \ddots equivalents of the AMS-LaTeX
\hdotsfor. However, does LaTeX have a concept of diagonal at all??

Olivier Lefevre

0 new messages