Re: [Bug] rs_actiondrawellipsecenter3point
Posted by cantcode on Jun 15, 2013; 8:34pm
URL: https://forum.librecad.org/Bug-rs-actiondrawellipsecenter3point-tp5708194p5708359.html
can someone pleasse tell me why we have to square the vector??
"if( (sol.get(mSize) - sol.get(mSize-1)).squared() < RS_TOLERANCE15 ) {..."
so we take the last two vectors and subtract them to get a new vector.
why do we then use .squared afterwards?
Isn't the RS_TOLERANCE15 the length which tells us if we should consider the next point as a new one?
If so, then one would have to calculate the length of the new vector (coming from the subtraction).
IIRC, the length of a vector is calculated by squaring the x,y,z components, adding them and then square root the result.