Sketcher: Hyperbola: fix major radius formula
This commit is contained in:
parent
6fce841404
commit
180e01bcfc
|
@ -318,9 +318,11 @@ double Hyperbola::getRadMaj(const DeriVector2 ¢er, const DeriVector2 &f1, do
|
|||
{
|
||||
double cf, dcf;
|
||||
cf = f1.subtr(center).length(dcf);
|
||||
DeriVector2 hack (b, cf,
|
||||
db, dcf);//hack = a nonsense vector to calculate major radius with derivatives, useful just because the calculation formula is the same as vector length formula
|
||||
return hack.length(ret_dRadMaj);
|
||||
double a, da;
|
||||
a = sqrt(cf*cf - b*b);
|
||||
da = (dcf*cf - db*b)/a;
|
||||
ret_dRadMaj = da;
|
||||
return a;
|
||||
}
|
||||
|
||||
//returns major radius. The derivative by derivparam is returned into ret_dRadMaj argument.
|
||||
|
|
Loading…
Reference in New Issue
Block a user