⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 theta_impact.m

📁 一个有趣的桌面撞球模拟,可录制avi,输出坐标参数及图象
💻 M
字号:
%
%   This function recalculates the value of (Theta) depending on the impact
%   location
%
%
function th=theta_impact(th,width,height,x0,y0)
if th>0 & th<90
    if x0>=width
        th=180-th;
        return;
    elseif y0>=height
        th=360-th;
        return;
    end
elseif th>90 & th<180
    if x0<=0
        th=180-th;
        return;
    elseif y0>=height
        th=360-th;
        return;
    end
elseif th>180 & th<270
    if x0<=0
        th=540-th;
        return;
    elseif y0<=0
        th=360-th;
        return;
    end
elseif th>270 & th<360
    if x0>=width
        th=540-th;
        return;
    elseif y0<=0
        th=360-th;
        return;
    end
elseif th==0 | th==360
    th=180;
    return;
elseif th==90
    th=270;
    return;
elseif th==180
    th=0;
    return;
elseif th==270
    th=90;
    return;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -