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

在这里插入图片描述

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

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_Drho_atmospherearea/(2*mass)

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

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

k_L = C_Lrho_atmospherearea/(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.

源码下载地址:

http://page2.dfpan.com/fs/clcjb221e29126c7812/

更多精彩文章请关注微信号:在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值