PDA

View Full Version : Trying to modify a script-not sure what this means...


dwigfor
06-01-2006, 03:03 AM
Hi all,

I'm trying to modify a script that I posted on here (http://forums.cgsociety.org/showthread.php?t=308948 - Jscript: HalfKill (Deletes -X) and I'm not sure what something means..

I forget where I got that script from - I didn't write it. I want to change it so it deletes +X instead of -X.


// Array off point where pointPositionX < almost 0 [-1E-5]
var delPoints = new Array();
var pointIndex;
var pointPositionX;
for (i=0, pointIndex = 0; i < pArray.length; i += 3, pointIndex++) {
pointPositionX = pArray[i];
if (pointPositionX < -1E-5) {
delPoints.push(pointIndex);
}
}


I changed it to: if (pointPositionX > 0) { and it works for what I want it to do.

My question is, what does almost 0 [-1E-5] mean??

5quid
06-01-2006, 08:58 AM
It means Epsilon. 00000.1

ie, a very small number.

:)

/edit - sorry, missed the sign. in this case [-1E-5] means -0.00001

Jarno
06-01-2006, 09:14 AM
-1E-5 = -1x10(exp -5) = -0.00001
It's just a diverent way off writing a small number. try logmessage(-1E-5)

for more info about Scientific- and exponential notation see:
http://en.wikipedia.org/wiki/Scientific_notation

dwigfor
06-01-2006, 03:54 PM
ah. Thanks for the 1 x 10 ^ (-5) example. Makes perfect sense now. :)

CGTalk Moderation
06-01-2006, 03:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.