【源码】网球发球曲线的仿真模拟

编程入门 行业动态 更新时间:2024-10-24 08:22:17

【源码】网球发球<a href=https://www.elefans.com/category/jswz/34/1769778.html style=曲线的仿真模拟"/>

【源码】网球发球曲线的仿真模拟


用户可以自定义网球的初始位置、速度和旋转

The user defines the initial position, velocity, and spin of the tennis ball. 


单位分别是磅、英尺、秒。

The units are pounds, feet, seconds. 


网球场坐标为:

X-平面,垂直于网格

Y-平面,平行于网格

Z-离地高度

The tennis court coordinates are: 

x - ground, perpendicular to net 

y - ground, parallel to net 

z - height above ground 


网球路径取决于3种作用力:

1)重力

2)阻力

3)升力

The path taken depends on 3 forces: 

1) gravity (constant 32 ft/s^2 in -z direction 

2) drag (proportional to v^2 and in -v-hat direction 

3) lift (proportional to cross product of spin and velocity) 


阻力的比例常数与大气密度、球的横截面积、阻力系数和质量的倒数成正比:

The proportionality constant of the drag force is proportional to the atmosphere density, the cross-sectional area of the ball, the coefficient of drag, and the inverse of mass: 

k_D = C_D*rho_atmosphere*area/(2*mass) 


球的旋转使它上升。表达形式为:

Spin of the ball causes it to lift. The constant has similar form: 

k_L = C_L*rho_atmosphere*area/(2*mass) 


旋转将增加发球时的误差范围

Spin will increase the margin of error when serving. 


上旋(+y分量)产生向下的力,使球落下,需要发球者以更大的初始角度击球。

A top-spin (+y-component) creates a downward force causing the ball to drop and allowing the server to hit the ball at a greater initial angle. 


通过将y分量设置为负值,可以产生”回旋球“。

Backspin is created by setting the y-component to a negative value. 


网球曲线是通过4/5阶的龙格-库塔-费尔伯格方法进行求解的。

Propagation is via a Runge-Kutta-Fehlberg method of order 4/5.


模型标记条件:球弹出球场、球撞网或球反弹。

The model flags conditions: ball moves out of court, ball hits net, or ball bounces. 


反弹是用一个恢复参数来建模的,如果存在旋转,则是一个夹点参数,用于根据与地面接触时的滑动来更正速度。

The bounce is modeled with a restitution parameter and, if there is spin, a grip parameter to modify the velocities based on slipping during contact with the ground.


本代码有助于分析网球比赛的视频,以对发球初始条件进行反向工程,进行游戏模拟,以及“最终位置对初始发球位置、速度和旋转有多敏感”等假设问题。

Useful for analyzing video of tennis games to reverse-engineer initial conditions of a serve, for game simulations, and for what if questions such as "How sensitive is the final position to the initial serve position, velocity, and spin?" 


网球运动在火星上会是什么样子的?

"What would tennis look like on Mars?" 


空气密度如何影响网球的发球?

"How does atmospheric density affect tennis serves?"


参考文献: 

Danby, J. M. A. (1997) Computer Modeling: From Sports to Spaceflight ... From Order To Chaos, Willmann-Bell, Inc., Richmond, VA., p. 159.

更多推荐

【源码】网球发球曲线的仿真模拟

本文发布于:2024-02-11 20:30:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1683293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:曲线   网球   源码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!