re: abs
 
I would have thought that abs would be a reserved word, reserved for the function of returning the abs value.  But I know zero Java so I'm guessing.
 
var abs = new r3Integer(); // absolute value
 
It could not be called a variable. A variable of a suitable type needs to be declared and that variable can then be assigned an abs value of a mathematical _expression_.
 
I should probably pull my head in on this one.
 
Neil Cooke
----- Original Message -----
Sent: Tuesday, July 25, 2006 7:58 PM
Subject: How to calculate a "distance" code between two spheres?


Dear realsoft friends, during working for the ending of my colour script, I have built yesterday night a very interesting "distance" calculation and have some question to the professional script user :-)

a) "abs" - does it exist in realsoft _javascript_ language? (absolute value)

b) I will print the distance measure between two spheres as a result in a popup window (I manage it ;-)

 

one little extract of my code lines :-) -------------------

function myVectorDistanceHook(obj, event, value)

{

var AV;

var V;

var AV2;

var abs = new r3Integer(); // absolute value

var distance = new r3Vect();

// var distance = 1;

var Pos = new r3Vect();

var Pos1 = new r3Vect();

var Pos2 = new r3Vect();

var x = new r3Vect();

var z = new r3Vect();

var y = new r3Vect();

var result;

  v1 = new r3Vect(0.2, 0.1, 0.4);

 v2 = new r3Vect(0.1, 0.15, 0.5);

 

// AV1 = Math.abs(x);
// AV2 = Math.abs(z);

      AV1 = Pos1.x - Pos2.x;  // 346

      AV2 = Pos1.z - Pos2.z;

      A = Math.sqrt(AV1*AV1 + AV2*AV2);

      V = Pos1.y - Pos2.y;

      outObjA_distance = A; // outObjdistance ?

      outObjV_distance = V;

}

------------------------ extract end

 

perhaps somebody can help me, would be great ! :-)))

have all a nice day, bye, regards, frank brübach, germany



XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!    
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130  

Reply via email to