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...
By bi on the 9th of Feb 2010 10:56:02 PM
Download |
Raw |
Embed |
Report
proc float getPointPlaneDistance(string $planeName, string $nameLoc)
{
float $planeEq[] = `getPlaneEquation($planeName)`;
float $loc[] = `xform -ws -q -t $nameLoc`;
float $dividend = ( ($planeEq[0] * $loc[0]) + ($planeEq[1] * $loc[1]) + ($planeEq[2] * $loc[2]) + $planeEq[3]);
print ("\n dividend \n");
print $dividend;
float $divisor = (sqrt(($planeEq[0]*$planeEq[0]) + ($planeEq[1]*$planeEq[1]) + ($planeEq[2]*$planeEq[2])));
float $dist = ($dividend)/($divisor);
print ("\n distance from point to plane \n");
print $dist;
//returns float distance
return $dist;
}
Submit a correction or amendment below.
Make A New Post