http://nehe.gamedev.net/data/articles/article.asp?article=10
toto za tymto: And now how to finally determine the angle A we use the formula...
Fórum › Matematika
Trochu viac nerozumiem tomu cos

Alebo potrebujem zistit uhol v nepravouhlom trojuholniku ak poznam jeho strany
Edit:
resp. zistit jeho vysku na hocijaku stranu
To Tocimanko : jj cosinova veta ... jen pro zajimavost: zvlastni pripad cosinovy vety je pythagorova veta.. kdy koeficient s cosinusem pri 90stupnich vypadne (cos(90) = 0) :)
no, ale nepoznam kosinusovu vetu, lebo som este len v 9. r. na zakladnej (idem na strednu), a tu sme sa ucili kosinus len pri pravouhlom trojuholniku
c^2 = a^2 + b^2 - 2ab * cos(gama)
Náhoda, zrovna dneska jsem s ní něco počítal:)
diki, sice sa mi to uz podarilo urobit, ale zijdu sa vzorce
tu je moj upraveny kod pre obdlznik
// angle of mouse
Vector2 mouse = layout.display3D.MouseTan;
// tangenses of view to rectangle points angles
Vector2 tan_p_a = MathHelper.AngleTan(layout.display3D.eye, Point_A);
Vector2 tan_p_b = MathHelper.AngleTan(layout.display3D.eye, Point_B);
Vector2 tan_p_c = MathHelper.AngleTan(layout.display3D.eye, Point_C);
Vector2 tan_p_d = MathHelper.AngleTan(layout.display3D.eye, Point_D);
// (p)M distances from points P to mouse
float AM = MathHelper.Distance(tan_p_a, mouse);
float BM = MathHelper.Distance(tan_p_b, mouse);
float CM = MathHelper.Distance(tan_p_c, mouse);
float DM = MathHelper.Distance(tan_p_d, mouse);
// (p1)(p2) distances form points p1 to p2
float AB = MathHelper.Distance(tan_p_a, tan_p_b);
float BC = MathHelper.Distance(tan_p_b, tan_p_c);
float CD = MathHelper.Distance(tan_p_c, tan_p_d);
float DA = MathHelper.Distance(tan_p_d, tan_p_a);
// angles of sub triangles
float a_acos = (float)Math.Acos(((AB * AB) - (AM * AM + BM * BM)) / ( -2 * AM * BM));
float b_acos = (float)Math.Acos(((BC * BC) - (BM * BM + CM * CM)) / ( -2 * BM * CM));
float c_acos = (float)Math.Acos(((CD * CD) - (CM * CM + DM * DM)) / ( -2 * CM * DM));
float d_acos = (float)Math.Acos(((DA * DA) - (DM * DM + AM * AM)) / ( -2 * DM * AM));
// total angle, must be 2Pi if point is in triangle
float angle = a_acos + b_acos + c_acos + d_acos + 0.0001f;
if(angle < Math.PI * 2)
return false;
else
return true;
ak by ste vedeli nejake vylepsenia mozete poslat, a commenty nesu moc gramaticky kvalitne, ale nevadi

Přidej příspěvek
Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×






























































Uživatelé prohlížející si toto vlákno
Uživatelé on-line: 0 registrovaných, 15 hostů