zoukankan      html  css  js  c++  java
  • 回旋曲线的计算

     

     

    %% 调用 clothoid函数,并将终点位置的曲率半径设置为 0.1:0.2:3
    for i = 0.1:0.2:3
        clothoid(i)
    end
    
    %%%% 计算回旋曲线,并绘图
    function [] = clothoid(Rmin)
    
    N = 100; %% 
    sk = 2; %% 曲线长
    c = 1 / Rmin / sk; %% 曲率变化率,即上文中的曲率变化率 a
    x = zeros(1,N);
    y = zeros(1,N);
    
    for sk_i = sk / N : sk / N : sk
        result_x = 0; %% 初始化x坐标点的值
        result_y = 0; %% 初始化y坐标点的值
        
        for i = 0 : N %% 计算x
            result_x = result_x + ((-1) ^ i) * (c ^ (2 * i)) * (sk_i ^ (4 * i + 1)) / ((2 ^ (2 * i)) * (4 * i + 1) * fctorial(2 * i));
        end
        x(int32(sk_i / sk * N)) = result_x;
        
        for i = 0 : N %% 计算y
            result_y = result_y + ((-1) ^ i) * (c ^ (2 * i + 1)) * (sk_i ^ (4 * i + 3)) / ((2 ^ (2 * i + 1)) * (4 * i + 3) * fctorial(2 * i + 1));
        end
        y(int32(sk_i / sk * N)) = result_y;
        
    end
    
    hold on;
    plot(-x,-y);
    hold on;
    plot(-x(end),-y(end),'*'); %%回旋曲线的最后一个点
    axis equal;
    end
    

     

    _________________________________________________________________________________________________________________________________________________
    每一个不曾起舞的日子,都是对生命的辜负。
    But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
    其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采
  • 相关阅读:
    OC-重写构造方法
    OC-变量作用域
    极光推送
    iOS 学习笔记-关于Button
    关于UIButton的一些用法
    关于tableviewCell 使用的心得
    Xcode 7.2更新插件失败的解决办法
    源代码管理工具的使用心得
    ARC的应用
    OC中的内存管理02
  • 原文地址:https://www.cnblogs.com/leoking01/p/14506568.html
Copyright © 2011-2022 走看看