182 reputation
5
bio website applegrew.com
location
age 28
visits member for 3 years
seen Aug 30 '13 at 14:00

Aug
30
comment How to take one's complement of a positive integer?
I think it should be $2^{b+1}-1$ if I assume MSB is not reserved for sign bit.
Aug
30
accepted How to take one's complement of a positive integer?
Aug
30
asked How to take one's complement of a positive integer?
Sep
19
comment How to find the center of an ellipse?
[Updated] To All. A demo of this code implemented using Javascript can be found at jsfiddle.net/ZxRBT.
Aug
30
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
@J.M. I am working with scalars. $P_i$ is just the xy of the point, no direction sense in that. I in fact have a working code in Javascript which does exactly the thing I want, in exactly the way I expect it to. Unfortunately, the actual code where I wanted it to work is way too complicated. If I think trough that then maybe I might understand what is different there. Anyway, whatever works! :)
Aug
30
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
@newbie I am using these matrices to draw stuffs on HTML canvas.
Aug
30
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
I have solved my issue. :) I am still not sure why, but If I to use $T_2*T_1^{-1}$ instead, then it works! My matrices handle only 2D case, not 3D. In my case the transform, may contain translation, scaling, skew too along with rotation.
Aug
30
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
@newbie It is like your example except that it has one more column and row. As shown at wikipedia.
Aug
29
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
@newbie I really didn't get your question.
Aug
29
comment How to find the $P_2$ when $T_1P_1=T_2P_2$
@J.M. For any values of $T_i$ and $P_i$ it gives me trouble. The value of $P_2$ I get is quite far off. I am not sure what's going on but I rechecked the program a number of times and the logic seems to be fine. From your response it seems there aren't any more corner cases. Then I guess I need to revisit my code again.
Aug
29
asked How to find the $P_2$ when $T_1P_1=T_2P_2$
Aug
20
awarded  Quorum
Aug
5
comment How to find the center of an (scaled) ellipse?
@J.M. Can you please explain this? Maybe you can put it as an answer.
Aug
5
comment How to find the center of an (scaled) ellipse?
@Steven The input data come from users. These info are used to draw an elliptical curve between $P_0$ $P_1$. The drawn curve is scaled up by 300, otherwise it will be too small. You can know more about this at cink.applegrew.com
Aug
4
comment How to find the center of an (scaled) ellipse?
@J.M. Yes this is much better, but there is still one value for which I see a spike in error. It is - $P_0=(1.15,0)$, $P_1=(1.1,0.355)$, $\alpha=0$, $r_x=r_y=1$. In this I get $c=0.1792519177024335$, $C_1=(1.5048143686806574,-2.2273133985451077)$ and $C_2=(0.7459452600567043,2.5824203885081163)$. The y value seems to be larger than expected. Instead of using your above tip if I use the old method of calculating $s$ first then dividing then the values of y calculates to $-5.990619417072389$ and $6.34589383623051$! And yes x value too changes. All for the same inputs!
Aug
4
comment How to find the center of an (scaled) ellipse?
But the problem of error at $\sqrt{1-c^2}$ remains the same. Maybe refactoring that to $\sqrt{1-c}\sqrt{1+c}$ may help. Not sure. Any advice?
Aug
4
comment How to find the center of an (scaled) ellipse?
@joriki, @ J.M. I have finally understood the source of problem. The problem is in the computers all rationals are approximated. So if I say $P_0$ is at $(0, 1.3)$ then computer may not store the exact value of $1.3$. In this the approximation may make it $1.299999998$. That's an error. When I scale this value by (say) 300 then this error too blows up and becomes obviously clear. So to fix this I can multiply all input variables by (say) a 500 and later divide the computer coords by this to get the ans.
Aug
4
comment How to find the center of an (scaled) ellipse?
@J.M. Why that would be inaccurate? I didn't get you. Maybe whatever you are referring to could be the source of my grief and I drove offcourse.
Aug
4
comment How to find the center of an (scaled) ellipse?
Oohh.. It's seems I have been banging my head against this problem for too long. JS is not the problem it seems. Thanks J.M. for knocking me into senses. :P
Aug
4
asked How to find the center of an (scaled) ellipse?