フィルターのクリア

x-coordinate for specific point in a triangle

1 回表示 (過去 30 日間)
Lily
Lily 2014 年 3 月 1 日
コメント済み: Roger Stafford 2014 年 3 月 1 日
I'm trying to find a x-coordinate for the point (x,12) in triangle. The points of the are:
A = (0.2, 10)
B = (0.5, 10)
C = (0.2, 16)
The point (x,12) is on the BC-line. Can you help me?

採用された回答

Roger Stafford
Roger Stafford 2014 年 3 月 1 日
This is an elementary analytic geometry problem. Write an expression for the slope of the line segment between B and C, and set it equal to the slope of the line segment between B and (x,12). Then solve this equation for the unknown x. Almost no matlab needed.
  3 件のコメント
the cyclist
the cyclist 2014 年 3 月 1 日
There are many ways to skin a cat, Lily. I agree with Roger that "almost no matlab" is needed. That being said, what you are asking for is a point along the linear interpolant of B and C, and there does exist a MATLAB function to do that:
interp1([10 16],[0.5 0.2],12)
gives the x value you want.
Roger Stafford
Roger Stafford 2014 年 3 月 1 日
I agree with you, cyclist, but since you have a great many more points than I do in "Answers", I will greedily accept the credit here. I admittedly have a tendency to use mathematical non-matlab methods whenever they seem reasonably simple.

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

その他の回答 (1 件)

the cyclist
the cyclist 2014 年 3 月 1 日
You can use the interp1() command to do this.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by