Finding the coordinates of a point given the gradient, distance and one set of coordinates
10 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Torsten
on 27 Jun 2022
Edited: Torsten
on 27 Jun 2022
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 Comments
Torsten
on 30 Jun 2022
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]
More Answers (0)
See Also
Categories
Find more on Discrete Multiresolution Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!