function ht_plot(ti, si, xs, ys) ti = ti/180*pi; if ti>=0 Y = si/cos(ti) +1; X = si/cos(pi/2-ti) +1; if X>1e18 X=1e18; end if Y>1e18 Y=1e18; end plot([1 Y],[X 1], 'r','LineWidth',3) elseif si>=0 Y = si/cos( abs(ti) ) +1; X = (ys-Y)*tan(pi/2-abs(ti)) +1 ; if X>1e18 X=1e18; end if Y>1e18 Y=1e18; end plot([ys Y],[X 1], 'r','LineWidth',3) else Y = abs(si)/cos( pi/2-abs(ti) ) +1; X = (ys-Y)*tan(abs(ti)) +1; if X>1e18 X=1e18; end if Y>1e18 Y=1e18; end plot([X 1],[ys Y], 'r','LineWidth',3) end