Re: Silly question



Wao, of course! Why didn't I think of that?

Now this is why I just love this group!
My question answered in 30 minutes.
Thanks Robert

"Robert Israel" <israel@xxxxxxxxxxx> wrote in message
news:deu91c$ejc$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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

  • Re: Question about Eurekalog
    ... on out of college was as a technical writer for an Insurance group! ... Of course when you're writing tech documentation one can't meander off ... newsgroups like this I would not even bother coming here because I ... from Robert Meek dba Tangentals Design ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Freedom of speech lost; Imus isnt so bad as to be fired?
    ... effective writing. ... Robert, we can do this from the top. ... are responsible for the defense and advancement of free speech? ...
    (alt.usage.english)
  • Re: Question about Eurekalog
    ... It's funny you should say that, as one of the very first jobs I took ... If I tried in anyway to censor my writing on ... newsgroups like this I would not even bother coming here because I consider ... from Robert Meek dba Tangentals Design ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Red Dwarf- New series?
    ... possibly accounts for the dreadful standard of writing. ... Robert Lllewelyn's site says that originally it was going to be a ...
    (uk.rec.motorcycles)
  • RE: C# Command to Wait a Specified Period of Time
    ... "Robert E. Flaherty" wrote: ... I am writing a windows service that will process a file once it has beed ...
    (microsoft.public.dotnet.languages.csharp)