draw a line with known slope and one set of coordinates

29 次查看(过去 30 天)
I know the coordinates of the starting position of the line (x1,y1). I also know the angle the line makes how to find the second set of coordinates and plot the line?

采纳的回答

dpb
dpb 2020-7-7
m=tan(theta); % tan()=y/x --> slope
b=y1-m*x1; % intercept to pass thru x1,y1 at given slope.
coeff=[m b]; % coefficient array for convenience
yh=polyval(coeff,[x1 xEnd]); % evaluate line from x1 to some end point of choice

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by