Jump to content

Staying behind after class


Profaitchikenz Haiku
 Share

You are about to reply to a thread that has been inactive for 956 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Um, actually. . . if you transpose the arguments to llAtan2() Don't you get the clock-angle?

vector clock_00 = <0,1,0>; // points up. (when viewed birds-eye)
vector clock_03 = <1,0,0>; // points to the right.
vector clock_06 = <0,-1,0>; // points down
vector clock_09 = <-1,0,0>;

llAtan2(clock_00.x,clock_00.y) // returns 0 degrees past noon.
llAtan2(clock_03.x,clock_03.y) // returns PI_BY_TWO degrees past noon.
llAtan2(clock_06.x,clock_06.y) // returns PI degrees past noon.
llAtan2(clock_09.x,clock_09.y) // returns PI+PI_BY_TWO degrees past noon.
  

 

Link to comment
Share on other sites

But that's not transposing anything.  Prof is after this:

default
{
    touch_start(integer total_number)
    {
        vector test = <5,4,3>;
        vector clock_00 = <0,1,0>; // points up. (when viewed birds-eye)
        
        llSay(0,"llAtan2(test.x, clock_00.y) = " + (string) llAtan2(test.x, clock_00.y));
        llSay(0,"llAtan2(clock_00.y, test.x) = " + (string) llAtan2(clock_00.y, test.x));
    }
}

llAtan2(test.x, clock_00.y) = 1.373401
llAtan2(clock_00.y, test.x) = 0.197396

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Rolig Loon said:

But that's not transposing anything

Huh, I agree your example is much more nonsensical. I suppose we have different definitions of "transpose". in my example I showed that while llAtan2 is "supposed" to be used in y,x order, reversing the argument order gives a result which is to my mind, sensible, but certainly non-standard. "transpose" in that context meaning changing the order of a single ordered thing (the components of a single vector). I'm not sure of a context where "transpose" means switching arguments between two different things, in linear algebra for example "transpose" is a unary operation acting on a single matrix (although you could argue the transposition switches components between different component vectors of the matrix. . .)

  • Thanks 1
Link to comment
Share on other sites

True, but I rather suspect Prof had the more literal meaning of "transpose" in mind, rather than the matrix definition, as in "Don't mess up and reverse the order of variables you stick into the llAtan2 function".    That's the kind of absent-minded blunder a scripter's likely to make.  Of course, I've never done that .... 🙄

  • Haha 1
Link to comment
Share on other sites

What happened was I got results that seemed a partial mirror-image of what I was expecting in quadrants 1 and 2, quadrants 3 and 4 were even more absurd.

It was only after I'd written a version of Atan2 from scratch and got the expected results that I looked back and saw what I had done, llAtan2(coords.x, coords.y) 

It's just habit, I suppose, always thinking in terms of X and Y

7 hours ago, Rolig Loon said:

That's the kind of absent-minded blunder a scripter's likely to make. 

Actually, I think it's due to the holiday I took a few years back. I thought I was going to Eritrea but somehow ended up in Geriatria

  • Like 1
  • Haha 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 956 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...