Splined epitrochoid


Autor:
Credit:
Ten plik jest pochodną pracą: Splined epitrochoid.pngSplined epitrochoid.png
źródło:
Wymiary:
369 x 363 Pixel (52487 Bytes)
Opis:

Made with Sage; code is as follows:

# Five-petaled epitrochoid via splining the points:
# Draw an epitrochoid, fixed circle radius R, rotating circle
# of radius r, pen at distance d from center of rotating circle.

R = 5
r = 2
d = 3
rotations = ((R + r) / r).denom()
v = []
step = 0.2
for t in srange(0, 2 * pi * rotations, step):
    v.append(((R + r) * cos(t) - d * cos(((R + r) / r) * t),
             (R + r) * sin(t) - d * sin(((R + r) / r) * t)))
x_spline = spline([(RDF(i) / len(v), v[i][0]) for i in range(len(v))] + [(1, v[0][0])])
y_spline = spline([(RDF(i) / len(v), v[i][1]) for i in range(len(v))] + [(1, v[0][1])])
show(points(v, rgbcolor=(1, 0, 0), pointsize=10) + parametric_plot((x_spline, y_spline), (x, 0, 1), thickness=0.5),
                                                                   figsize=[4, 4], ticks=[2.5, 2.5], xmin=-10)
Licencja:
Public domain

Więcej informacji o licencji można znaleźć tutaj. Ostatnia aktualizacja: Tue, 22 Mar 2022 08:08:37 GMT