Recent Posts
None | 37 sec ago
None | 51 sec ago
None | 1 min ago
None | 1 min ago
Java | 1 min ago
None | 1 min ago
PHP | 1 min ago
None | 2 min ago
None | 2 min ago
Java | 2 min ago
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By bi on the 9th of Feb 2010 10:56:02 PM Download | Raw | Embed | Report
  1. proc float getPointPlaneDistance(string $planeName, string $nameLoc)
  2. {
  3.         float $planeEq[] = `getPlaneEquation($planeName)`;
  4.         float $loc[] = `xform -ws -q -t $nameLoc`;
  5.  
  6.         float $dividend = ( ($planeEq[0] * $loc[0]) + ($planeEq[1] * $loc[1]) + ($planeEq[2] * $loc[2]) + $planeEq[3]);
  7.        
  8.         print ("\n dividend \n");
  9.         print $dividend;
  10.         float $divisor = (sqrt(($planeEq[0]*$planeEq[0]) + ($planeEq[1]*$planeEq[1]) + ($planeEq[2]*$planeEq[2])));
  11.         float $dist = ($dividend)/($divisor);
  12.        
  13.         print ("\n distance from point to plane \n");
  14.         print $dist;
  15.  
  16.         //returns float distance
  17.         return $dist;
  18.        
  19. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: