Do I miss some conditon, or maybe I have some extra's
My formula is probably ok., I think I get WA because of special conditions so here is what I check:
1. ad*ac-bd*bc == 0 => impossible, because we can't divide with zero.
2. ad*bc+ab*cd != ac*bd => impossible, because than orbit is not circle, according to Phtolomei's theorem
3. final score is cd=sqrt(formula), where "formula" is my math solution without root, so I check if formula<0, because there is no root of negative value.
Do I miss some conditon here (for some input value of ad, ac, bc, bd maybe?), or maybe I have some conditon that I don't need??
Please help me here!
Edited by author 11.05.2005 04:07
Re: Do I miss some conditon, or maybe I have some extra's
In my AC solution I didn't use the second condition.
In what type you store data? int, int64, double?
Re: Do I miss some conditon, or maybe I have some extra's
I store data in double and int, I have few conversion double->int and oposite. Do I need __int64 or long double?
Re: Do I miss some conditon, or maybe I have some extra's
In my AC program I used only double.
Try to change all int to double.
Re: Do I miss some conditon, or maybe I have some extra's
Perhaps my formula is wrong, here it is :
(I used characteristics of inscribed ugle and cosin theorem)
cd = (ad*ad + ac*ac - (ad*ac*bd / bc) - (ad*ac*bc / bd)) /
( 1 - (ad*ac / (bd*bc)));
cd = sqrt(cd);
Maybe this exspression where I divide (1 - (ad*ac / (bd*bc)) is not good for some input data because I forbid divide with zero?
Edited by author 13.05.2005 00:36
Edited by author 13.05.2005 04:45
this problem cos_a can be > 1
1. ad*ac-bd*bc == 0 => impossible, because we can't divide with zero.
2. ad*bc+ab*cd != ac*bd => impossible, because than orbit is not circle, according to Phtolomei's theorem
3. final score is cd=sqrt(formula), where "formula" is my math solution without root, so I check if formula<0, because there is no root of negative value.
1 yes
2 no
3 Through system of the equations express cos_a, and then find the side.
No subject
Why if ad*ac-bd*bc==0 it's impossible? In some place it is really impossible, but not for test:
1 2 2 1
I can select any length from interval (1,3) and it should be right answer!
It's not impossible, but in this case it *is* impossible to determine DC unambiguously, so the anwer is "Impossible." (-)
-