However Mortenson points out that we are better if we minimize the error rather than allow all the error to be on one side of the circle.
The if the naive geometry solution is the same we get:
And finally we have Mortensen's solution to it, by making the metric for closest be the average error across the entire graph.
Well, solving this for 1 control point means doing the same thing he did. Which isn't super-trivial because it means calculating min and max error and adjusting various things. So I wrote a program to do it.
Your C points in Quad Bezier curves are:
C= 0.92519820883625651516056680057654772234129017577799879993432335355559372311727101122467939843041708056568481020881580812152533756252840773920708961655740969447362217856208142868847332990974178763987890
Having the program I refigured it for Cubic:
0.55191502449351057074356272279256664233618039472430889733698053746758709885277817592685338345358001614300815257463095148547403466508799941938848910944812198495136713728128014911200347760723733292314480
Having a deviation in both directions of: ±0.00019607646987687817401874512914923 ....
Mortensen gave this as,
0.551915024494
Since we might well be using doubles I'd give it as:
0.5519150244935106
M0,1
C0.5519150244935106,1 1,0.5519150244935106 1,0
C1,-0.5519150244935106 0.5519150244935106,-1 0,-1
C-0.5519150244935106,-1 -1,-0.5519150244935106 -1,0
C-1,0.5519150244935106 -0.5519150244935106,1 0,1
And the c value for the quad bezier curve as:
0.9251982088362565
M0,1
Q0.9251982088362565 0.9251982088362565 1,0
Q0.9251982088362565 -0.9251982088362565 0,-1
Q-0.9251982088362565 -0.9251982088362565 -1,0
Q-0.9251982088362565 0.9251982088362565 0,1
This is much better than the more naive value: 0.91421356237 which is effectively unusable. While Mortensen's use for the cubic is great, it changes the quad naive to almost usable, generally not, but *almost* usable. The Mortensen-optimized value for quads is off by max 0.007767318 whereas the naive value is off by 0.010781424258 which is 28% better. Hm. That's the same value Mortensen got for the cubic.
Naive Quad: For comparison.
No comments:
Post a Comment