Mcronin Posted October 23, 2003 Share Posted October 23, 2003 Where exactly does the . (dot product) operator fall in the order of precendence in PRMan? Is it above, below, or at the same level as a unary minus? If anyone has a complete list of PRMan's order of precendence I'd really appreciate it. It doesn't seem to be in any of the books I have. Quote Link to comment Share on other sites More sharing options...
Mcronin Posted October 26, 2003 Author Share Posted October 26, 2003 Nobody, huh? Well unless someone says different, I'm going to assume the unary minus is higher and dot product falls in after modulus. Quote Link to comment Share on other sites More sharing options...
edward Posted October 26, 2003 Share Posted October 26, 2003 Suppose we have two vectors u=(u1,u2,u3) and v=(v1,v2,v3). Then: (-u).v = (-u1,-u2,-v3).(v1,v2,v3) = (-u1*v1,-u2*v2,-u3*v3) = -(u1*v1,u2*v2,u3*v3) = -(u.v) Quote Link to comment Share on other sites More sharing options...
Mcronin Posted October 26, 2003 Author Share Posted October 26, 2003 OK, thanks for making me feel like a complete ass. I guess it was a really dumb question. I was just looking at the code and not thinking it through. Quote Link to comment Share on other sites More sharing options...
edward Posted October 26, 2003 Share Posted October 26, 2003 Not at all, it's happened to me more than a few times. I would tend to think that unary operators always have a higher precedence than binary operators regardless. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.