フィルターのクリア

solve an equation for perspective projection

2 ビュー (過去 30 日間)
koizomi
koizomi 2014 年 4 月 24 日
コメント済み: koizomi 2014 年 4 月 29 日
Hi guys I got an equation need to simplify but am new to simplify command
D^2=(xa-xb)^2+(ya-yb)^2+(Za-Zb)^2
knowing that:
xa=-f*Xa/Za
xb=-f*Xb/Zb
ya=-f*Ya/Za
yb=-f*Yb/Zb
what i want is to simplify the equation to this form :
af^2+bf+c=0
thank you for help in advance regards,

採用された回答

K
K 2014 年 4 月 24 日
Hi,
I'm sure this isn't the best solution, but if you enter f, Xa,Xb,Ya,Yb,Za, and Zb as symbols, and then enter your four constraints, and then your equation for D^2, and then use expand, you can pretty easily read off the terms and group them as you like in the quadratic form. I am sure there is a better way, but thought this might help you move along until someone has a better idea.
syms f Xa Xb Za Zb Ya Yb xa=-f*Xa/Za;
xb=-f*Xb/Zb;
ya=-f*Ya/Za;
yb=-f*Yb/Zb;
D2=((xa-xb)^2+(ya-yb)^2+(Za-Zb)^2);
expand(D2)
  2 件のコメント
Walter Roberson
Walter Roberson 2014 年 4 月 24 日
collect(D2, f)
koizomi
koizomi 2014 年 4 月 29 日
thank K and Walter that help alot

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by