예제 #1
0
def change_figure(n_intervals):
    r = l[n_intervals % 500]
    # r = [r.x, r.y, r.z] * u.km
    radius = (norm(r) - Earth.R) * 0.5

    d2 = dict()
    xx, yy, zz = generate_sphere(radius, r)
    d2['x'], d2['y'], d2['z'] = xx.value, yy.value, zz.value
    return [d2], [2], 20
예제 #2
0
파일: core.py 프로젝트: zupeiza/poliastro
    def _draw_sphere(self, radius, color, name, center=[0, 0, 0] * u.km):
        xx, yy, zz = generate_sphere(radius, center)
        sphere = Surface(
            x=xx.to(u.km).value,
            y=yy.to(u.km).value,
            z=zz.to(u.km).value,
            name=name,
            colorscale=[[0, color], [1, color]],
            cauto=False,
            cmin=1,
            cmax=1,
            showscale=False,
        )
        self._figure.add_trace(sphere)

        return sphere
예제 #3
0
파일: core.py 프로젝트: poliastro/poliastro
    def _plot_sphere(self, radius, color, name, center=[0, 0, 0] * u.km):
        xx, yy, zz = generate_sphere(radius, center)
        sphere = Surface(
            x=xx.to(u.km).value,
            y=yy.to(u.km).value,
            z=zz.to(u.km).value,
            name=name,
            colorscale=[[0, color], [1, color]],
            cauto=False,
            cmin=1,
            cmax=1,
            showscale=False,
        )
        self._figure.add_trace(sphere)

        return sphere