noc2 Posted January 16 Share Posted January 16 Hi; I have quite a simple question on a seemingly simple task, yet I'm kinda confused. If you check out the snapshot attached, you'll see that I tried to create Outward facing normals on a circle and also vectors facing along the positive Z axis in a parallel fashion. When I go ahead and get the dot product of these 2 vectors, I know I should get scalar values between -1 and 1. Yet, when you check out points 0, 2, 4 and 6, not all the values are as they should be. The dot product on points 0 and 4 seem to be correct, yet I'm getting off values for the other 2. What do you think I'm doing wrong? Thank you so much in advance; AJ Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted January 17 Share Posted January 17 Nothing wrong with the results (the small values near zero are due to the numerical accuracy) 1 Quote Link to comment Share on other sites More sharing options...
noc2 Posted January 17 Author Share Posted January 17 (edited) Hi @Aizatulin Thanx for your reply. The problem that I'm seeing is that the values go beyond -1 and 1. Shouldn't they yields be confined to that bracket only? And with both vectors normalized, I find the results to be off Edited January 17 by noc2 Quote Link to comment Share on other sites More sharing options...
animatrix Posted January 17 Share Posted January 17 The values you outlined are not outside [-1, 1]. Some of them are just really small values. 1 Quote Link to comment Share on other sites More sharing options...
noc2 Posted January 17 Author Share Posted January 17 17 minutes ago, animatrix said: The values you outlined are not outside [-1, 1]. Some of them are just really small values. Oh jeez... Thanx @animatrix. So, I guess I'm add odds as to how to read those values. Lastly, I really want to be able to read those values correctly. So, the dot product at point #2 reads: 4.37114e-08 as is. I'm aware that it should be very closely biased toward 0 as the angle is seemingly almost 90 degrees between the 2 vectors. What is the right way to interpret such numeric yields, for someone like me, who expects to see literally something like -0.00001 or something? Lotsa cheers; AJ Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted January 17 Share Posted January 17 You can do something like this: if (abs(f@dot) < 1e-6){f@dot = 0;} 2 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.