Make a line of same magnitude move in opposite direction at endpoint

1 回表示 (過去 30 日間)
Aarav Shah
Aarav Shah 2019 年 11 月 29 日
コメント済み: darova 2019 年 11 月 29 日
xyValues = dlmread('Batman.txt');
xsLogo = xyValues(:,1);
ysLogo = xyValues(:,2);
%BatBeam
launchBeam = plot(xClic + xsLogo,yClic + ysLogo,'k');
hText = text(xClic,yClic,'BatBeam');
title('Alright, your laser is gonna fire now');
% Plot that point
plot(xClic, yClic)
xlim([0,100])
ylim([0,100])
hold on
% Compute y intercept for slope of 1
b = yClic+1*xClic;
% Plot the line between the click point and the y intercept
batBeam = plot([xClic,0],[yClic,b],'b--');
This code plots a dashed line depending where the user clicks and the line always ends when x=0. I want to start a new line of the same magnitude move in an opposite direction starting at the current endpoint. Any pointers? I need urgent help for a project and appreciate legitimate answers with a tangible conclusion. Capture.PNG
  6 件のコメント
Aarav Shah
Aarav Shah 2019 年 11 月 29 日
That's awesome darova. Any chance to get that to happen a second/third time? This time bouncing off the top x axis and maybe the right y axis?
darova
darova 2019 年 11 月 29 日
Find intersection point and use vector again

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by