       RE: Functions with multiple groups of arguments? [David Park?]

• To: mathgroup at smc.vnet.net
• Subject: [mg40039] RE: [mg40031] Functions with multiple groups of arguments? [David Park?]
• From: "David Park" <djmp at earthlink.net>
• Date: Mon, 17 Mar 2003 03:33:12 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Tony,

I picked up that form from reading Alfred Gray's Modern Differential
Geometry book. For example, he writes the parametrization of a general
ellipse as

ellipse[a_, b_][t_] := {a Cos[t], b Sin[t]}

This separates the "parametrization" variable t from the shape parameters a
and b. To me, this is conceptually valuable, but there is also a Mathematica
advantage. We can easily calculate the velocity of a point on the curve
using the prime notation.

ellipse[a, b]'[t]
{-a Sin[t], b Cos[t]}

In other words, ellipse[a,b] is a function name.

If instead we had used the definition...

ellipse2[a_, b_, t_] := {a Cos[t], b Sin[t]}

we would have to use the more complicated statement

D[ellipse2[a, b, t], t]
{-a Sin[t], b Cos[t]}

or

Derivative[0, 0, 1][ellipse2][a, b, t]
{-a Sin[t], b Cos[t]}

to obtain the velocity.

?? ellipse
Global`ellipse
ellipse[a_,b_][t_]:={a Cos[t], b Sin[t]}

but where is this stored? It's stored in...

SubValues[ellipse]
{HoldPattern[ellipse[a_, b_][t_]] :> {a Cos[t], b Sin[t]}}

David Park

From: AES/newspost [mailto:siegman at stanford.edu]
To: mathgroup at smc.vnet.net

In a recent message on Mathematica programming, David Park included a
sample function definition in a form I've never encountered before,
namely

f[a_,b_,c_][x_]  := a + Sin[b x + c]

What is this?  How does it work?  (I can guess, but don't seem to find
anything about this in the Help files to confirm my guess)

Given the same values of a, b, c and x, does this form work differently
in *any* way from

f[a_,b_,c_, x_]  := a + Sin[b x + c]

If not, why do it this way? Or is the only reason for doing it this way
one of cosmetics?

???

--
"Power tends to corrupt.  Absolute power corrupts absolutely."
Lord Acton (1834-1902)
"Dependence on advertising tends to corrupt.  Total dependence on
advertising  corrupts totally." (today's equivalent)

```

• Prev by Date: discretization and plotting pde system
• Next by Date: RE: Re: This should evaluate to zero
• Previous by thread: Re: Re: discretization and plotting pde system
• Next by thread: Re: Functions with multiple groups of arguments? [David Park?]