Created
March 16, 2016 17:53
-
-
Save JokerMartini/506f11aa6ad1b9aec68e to your computer and use it in GitHub Desktop.
Maxscript: This demonstrates how to calculate the length of an arc when the radius and two points are known
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- length = 12.6 | |
-- radius = 10 | |
-- angle 72 | |
-- get arc length | |
arcLength = 2*pi*10*(72.0/360.0) | |
-- get arc angle | |
arcAngle = 360.0 * (2.0/10.0) | |
-- 2*10*(72.0/360.0) | |
-- 360 * (2.0/10.0) | |
-- How do I calculate arc angle between two points on a circle? | |
-- cos-1 ((x1x2 + y1y2 + z1z2) / r2) | |
-- startPoint = [3.0,5.196,0.0] | |
-- endPoint = [0.0,12.0,0.0] | |
startPoint = [6.749,8.043,0] | |
endPoint = [0.0,10.5,0.0] | |
origin = [0,0,0] | |
radius = 10.5 | |
print "Length of arc between two points with known radius" | |
x = startPoint.x * endPoint.x | |
y = startPoint.y * endPoint.y | |
z = startPoint.z * endPoint.z | |
acos( (x+y+z)/(pow radius 2) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment