[英]Find 2nd Derivative of Acceleration - UIAccelerate
Hi I'm working on an iOS app that requires finding the z value of the accelerometer and then deriving it twice of find the "Jounce" value. 嗨,我正在开发一个iOS应用,该应用需要找到加速度计的z值,然后两次推导得出“ Jounce”值。 Heres what I have so far:
这是我到目前为止的内容:
In 在
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
I get the "z" value of acceleration and assign it to a variable: 我得到加速度的“ z”值,并将其分配给变量:
float currentAccc = acceleration.z;
After this I don't know how to differentiate twice. 在此之后,我不知道如何区分两次。 How do I differentiate in Obj-C?
如何区分Obj-C?
Thanks 谢谢
You'll want to know something about finite differences in order to do this. 为此,您需要了解有关有限差分的一些知识。
A single discrete value is insufficient. 单个离散值不足。
A first order derivative wrt time would look like this: 一阶导数的wrt时间如下所示:
da/dt(t) ~ (a(t+dt)-a(t))/dt
d^2a/dt^2(t) ~ (da/dt(t+dt)-da/dt(t))/dt
(I could make this easier to read if I had LaTeX.) (如果我有LaTeX,则可以使它更易于阅读。)
You can use other formulas, but these are simplest. 您可以使用其他公式,但这是最简单的。
The ideas are commonly understood from differential calculus. 人们通常从微积分学中了解这些思想。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.