Hypotrochoid
1
R = 10;
2
r = 4;
3
d = 10;
4
a = 750;
5
6
x = (R-r)*Math.Cos(0..a)+d*Math.Cos(((R-r)/r)*(0..a));
7
y = (R-r)*Math.Sin(0..a)-d*Math.Sin(((R-r)/r)*(0..a));
8
9
p = Point.ByCoordinates(x,y);
10
s = NurbsCurve.ByPoints(p);
Copied!
1
//Hypotrochoid
2
R = 5;
3
r = 3;
4
d = 5;
5
a = 0..n..1;
6
x = (R-r)*Math.Cos(a)+d*Math.Cos(((R-r)/r)*a);
7
y = (R-r)*Math.Sin(a)-d*Math.Sin(((R-r)/r)*a);
8
p1 = Point.ByCoordinates(x,y);
9
10
//Graphics for animation
11
p2 = (Point.Origin().Translate(Vector.XAxis(),R-r))
12
.Rotate(Point.Origin(),Vector.ZAxis(),a);
13
l1 = Line.ByStartPointEndPoint(p1,p2);
14
c1 = Circle.ByCenterPointRadius(Point.Origin(),R);
15
c2 = Circle.ByCenterPointRadius(p2,r);
16
[p1,c1,List.LastItem(l1),List.LastItem(c2)];
Copied!
Last modified 1yr ago
Copy link