I try not to do anything of any significance before 3 cups of coffee. Err, make that "java" ;)
Scott
-----Original Message-----
From: Simeon H.K. Fitch [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 06, 2002 10:42 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] very simple question
bject: Re: [JAVA3D] very simple question
>
>
> Simeon H.K. Fitch wrote:
>
> > Given two points: P1 = (x1, y1, z1) and P2 = (x2, y2, z2)
> >
> > Distance is:
> >
> > double d = Math.sqrt(x1*x2 + y1*y2 + z1*z2)
>
> Well, what is the distance between (0,0,0) and (1,1,1) then ? Or
> (-1,-1,-1) and (1,1,1) ? :)
>
> You need to multiply differences between coordinates, not coordinates
> themselves.
Oops. My bad. I'll make a note not to try to be helpful so early in the
morning 8-O I end up causing more trouble.... :-P
double xdiff = x1-x2;
double ydiff = y1-y2;
double zdiff = z1-z2;
double d = Math.sqrt(xdiff*xdiff + ydiff*ydiff + zdiff*zdiff);
Simeon
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".