Re: Symbols in expression
- To: mathgroup at smc.vnet.net
- Subject: [mg89099] Re: [mg89079] Symbols in expression
- From: DrMajorBob <drmajorbob at att.net>
- Date: Sun, 25 May 2008 06:27:35 -0400 (EDT)
- References: <15605470.1211701065210.JavaMail.root@m08>
- Reply-to: drmajorbob at longhorns.com
It all depends. eqns = Array[r, 3] == {Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]} // Thread; Reduce[eqns, {u, v}] will return MANY solutions (not shown here). Wade through that thicket if you care to, but inspection yields a simpler approach. The third equation is easily solved: Solve[eqns1[[-1]], v] Solve::ifun: Inverse functions are being used by Solve, so some \ solutions may not be found; use Reduce for complete solution \ information. >> {{v -> -ArcCos[r[3]]}, {v -> ArcCos[r[3]]}} Dividing the first and second equations gives sides = List @@@ eqns; Solve[Equal @@ (sides[[1]]/sides[[2]]), u] Solve::ifun: Inverse functions are being used by Solve, so some \ solutions may not be found; use Reduce for complete solution \ information. >> {{u -> ArcCot[r[1]/r[2]]}} That cover mosts cases, but you still have to decide what sign to give v and what to do when r[2] and/or r[2] is zero. (Either way, the rule for u gives an undefined result.) Bobby On Sun, 25 May 2008 02:22:00 -0500, <sigmundv at gmail.com> wrote: > Dear all, > > Define, say, > > r = {Cos[u] Sin[v],Sin[u] Sin[v],Cos[v]}. > > How can I write a function, which takes r as an argument and returns a > list {u,v}? If we defined r[u_,v_]:=... it could be achieved fairly > easily using DownValues. But how can I achieve it in this case? > > Kind regards, > Sigmund Vestergaard > > -- DrMajorBob at longhorns.com