Recent Posts
None | 7 sec ago
C | 8 sec ago
Ruby | 35 sec ago
None | 40 sec ago
None | 46 sec ago
None | 49 sec ago
Bash | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
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 bitStudent on the 9th of Feb 2010 10:49:59 PM
Download |
Raw |
Embed |
Report
// fixed!
proc float getLinePlaneAngle(string $planeName, string $nameLoc1, string $nameLoc2)
{
float $loc1[] = `xform -ws -q -t $nameLoc1`;
float $loc2[] = `xform -ws -q -t $nameLoc2`;
print ("\n locators info \n");
print $loc1;
print $loc2;
// find locator vector
float $vLoc[3];
$vLoc[0] = $loc2[0] - $loc1[0];
$vLoc[1] = $loc2[1] - $loc1[1];
$vLoc[2] = $loc2[2] - $loc1[2];
float $vNorm[] = `getNormalVector($planeName)`;
float $magLoc = `sqrt( (($vLoc[0])*($vLoc[0])) + (($vLoc[1])*($vLoc[1])) +(($vLoc[2])*($vLoc[2])))`;
print $magLoc;
float $magNorm = `sqrt( (($vNorm[0])*($vNorm[0])) + (($vNorm[1])*($vNorm[1])) +(($vNorm[2])*($vNorm[2])))`;
print ("\n");
print $magNorm;
float $tempAngle = acosd( ((($vLoc[0])*($vNorm[0]))+ (($vLoc[1])*($vNorm[1])) + (($vLoc[2])*($vNorm[2]))) / ($magLoc * $magNorm));
print"\n temp angle: ";
print $tempAngle;
float $realAngle = 90 - $tempAngle;
print"\n real angle: ";
print $realAngle;
//returns float angle
return $realAngle;
}
Submit a correction or amendment below.
Make A New Post