Finding the coordinates of a point given the gradient, distance and one set of coordinates

6 views (last 30 days)
Adil Saeed
Adil Saeed on 27 Jun 2022
Commented: Adil Saeed on 30 Jun 2022
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.

Accepted Answer

Torsten
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)
x2 = 23.9272
y2 = z(2)
y2 = 9.5709
  13 Comments

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!