2sin30°在python中如何表示_如何在python中实现以下派生公式?

我尝试在python中实现以下关于X和Y点的公式

Lv0au.png

我尝试过以下方法def f(c):

"""This function computes the curvature of the leaf."""

tt = c

n = (tt[0]*tt[3] - tt[1]*tt[2])

d = (tt[0]**2 + tt[1]**2)

k = n/d

R = 1/k # Radius of Curvature

return R

有点不正确,因为它没有给我正确的结果。我想我在计算前两行的导数时犯了一些错误。我该怎么解决呢?在

以下是数据帧中的一些点:

^{pr2}$

在得到导数后,我使用以下代码将导数x_prim、x_prim、y_prim、y_prim_prim放入另一个数据帧中:d = pd.DataFrame({'x_prim': pts_x, 'y_prim': pts_y, 'x_prim_prim': pts_xx, 'y_prim_prim':pts_yy})

在数据帧中包含所有内容后,我将为数据帧的每一行调用函数,以使用以下代码获得该点的曲率:# Getting the curvature at each point

for i in range(len(d)):

temp = d.iloc[i]

c_temp = f(temp)

curv.append(c_temp)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值