Re: Silly question



In article <deu6pj$bqg$1@xxxxxxxxxxxxxxxxxx>,
Jaco van Niekerk <sparky@xxxxxxxxxx> wrote:
>Hello
>
>I have a torus, say F(u,v) = X(u,v)i + Y(u,v)j + Z(u,v)k
>
>with
> X(u,v) = Acos(u) + Bcos(u)cos(v)
> Y(u,v) = Asin(u) + Bsin(u)cos(v)
> Z(u,v) = Csin(v)
>
> A, B and C are constants

.... with, I presume, A > B > 0 and C > 0. Yes, this is a torus
for, say, -pi <= u <= pi and -pi <= v <= pi.

>Now, for the silly part. I have a point P that definitely lies on the
>surface. Now I need to find a pair (u,v) for the point P. Now this seems
>trivial, but on my graphics display (I'm writing a program) it does not
>work! This is what I've done:
>
>Pz = Csin(v)
>sin(v) = Pz/C
>v = arcsin(Pz/C)

That gives you a v in [-pi/2, pi/2];
OK if cos(v) >= 0, which is true if Px^2 + Py^2 >= A^2.
Otherwise v = pi - arcsin(Pz/C) (if Pz >= 0), or -pi - arcsin(Pz/C)
(if Pz < 0)

>Px = Acos(u) + Bcos(u)cos(v)
>Px = cos(u)[A + Bcos(v) ]
>since I have v, I can calculate u
>cos(u) = Px / (A + Bcos(v))
>u = arccos(Px / (A + Bcos(v)))

OK if Py >= 0. Otherwise -that.

>Yet, my u, v pair is not what it should be. What am I doing wrong?

Looking in the wrong intervals.

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

.



Relevant Pages

  • Is FFLL still alive?
    ... Writing an own ... library from scratch is always an option, but there's no doubt someone must ... Best regards, ... Prev by Date: ...
    (comp.ai.fuzzy)
  • Re: Selecting hole positions for wind instruments
    ... makers since the ancient Greeks started writing about it. ... See Pythagoras ... Pete ... Prev by Date: ...
    (rec.music.makers.builders)
  • Code cannot debug.
    ... I'm writing a small program. ... to debug by select, I got the following ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)
  • Stange Reboot issues
    ... much writing, followed by rebooting. ... which isnt really a solution. ... Prev by Date: ...
    (microsoft.public.windowsxp.perform_maintain)
  • Classical Music Theory
    ... out for him on a macroscopic level. ... But I've been also been told that music theory didn't really exist back ... structures generated were subconciously derived as he was writing it. ... Prev by Date: ...
    (rec.music.compose)