我有secp256k1椭圆曲线,我想在那条曲线上打印一个点。但是,这个点在曲线之外,我看不出为什么。
- Python 3.10.7语言
- 马尼姆0.17.2
谢谢你的帮助。
from manim import *
class eliptic_curves(MovingCameraScene):
def secp256k1(self, x):
return x ** 3 + 7
def construct(self):
ax = Axes(
x_range=[-10, 10]
)
# plot the x^3 + 7 = y^2 curve
graph = ax.plot_implicit_curve(lambda x, y : x ** 3 + 7 - y ** 2, color = BLUE)
self.add(ax, graph)
y = np.sqrt(self.secp256k1(1))
dA = Dot([1, y, 0], color = RED)
self.add(dA)
with tempconfig({"quality": "medium_quality", "preview": True}):
scene = eliptic_curves()
scene.render()
1条答案
按热度按时间xtupzzrd1#
好了,我终于找到了一个解决办法,坐标轴的坐标系和场景的坐标系是不一样的(当然),所以我需要用
ax.coords_to_point
的方法把一个Dot放到ax
坐标系的正确位置。