Finding the coordinates of a point given the gradient, distance and one set of coordinates
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi im trying to find the coordinates of a point given the gradient (m), distance (s) and one set of coordinates (x1,y1). I have a simultaneous equation that needs solving but cannot seem to find the numerical answers i have calulated by hand in MATLAB.
m = y2-y1/x2-x1 and s = sqrt((x2-x1)^2 + (y2-y1)^2)
given that:
m = 0.4
x1 = 10
y1 = 4
s = 15
and solving to find x2 and y2.
댓글 수: 0
채택된 답변
Torsten
2022년 6월 27일
편집: Torsten
2022년 6월 27일
m = 0.4;
x1 = 10;
y1 = 4;
s = 15;
z = [x1 y1] + s/sqrt(1+m^2)*[1 m];
x2 = z(1)
y2 = z(2)
댓글 수: 13
Torsten
2022년 6월 30일
v = 2; %harbor porpoises swim between 0.5 - 4.2 m/s
t = 5; %seconds
s = v*t; %metres
x0 = 0;
y0 = 0;
x1 = [1;2;3;4;5];
y1 = [6;7;8;9;10];
d = sqrt((x1-x0).^2+(y1-y0).^2); %Pythagoras Theorem for distance between the 2 (Source and Reciever) points
m = (y1-y0)./(x1-x0); %Gradient between the points
z1 = [x1,y1] + diag(s./sqrt(1+m.^2))*[ones(size(x1)),m]
z2 = [x1,y1] - diag(s./sqrt(1+m.^2))*[ones(size(x1)),m]
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Multiresolution Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!