c++ - General formula to generate a cubic bezier elliptical arc? -
How can I start an easy way to generate 2 missing control points for an oval ar in C? I do not need fancy error estimation, just some others who can take points A and D and can produce control points B and C for oval arc, where I can use the cubic beijier interpolation algorithm to generate the curve I am
Something like
zero GetArcControlPoints (point one, point & amp; B, point & c, point D) {..... B = .. C = ....}
thanks
its There are some flaws in mathematics behind your question:
-
Badgeer curves unit interval [0; 1] There are polynomial functions of a parameter T. The oval shapes are defined using trigonometric functions, which are reciprocal, thus, not algebraic, thus, not a polynomial. You can not generate an elliptical arc by using a bejier loan (neither cubic nor any degree n). But suppose you want to estimate only one oval arc. Since you have not specified how well the approximation will be, there is no way to ensure the "oval enough" for the bidder curve in some words: You need an error parameter.
-
There are infinite oval arrays passing through two given points. Thus, the two digits give not enough information to specify an ellipse, in which there is an arc that can be estimated using the bezier curve.
To make things even worse, because you want an ellipse arc, not the whole oval, you must also specify how much oval should be "covered" by arc, percent (100% = whole oval ), Radians (2 * pi = whole oval), whatever.In short words: You need more (input) parameters to specify a single arc of a single oval to
Unless the math is corrected, you can not go to the next step (coding).
Edit:
-
Since you need an entire ellipse, I want two or two instead of a bezier curve I would advise to use four bezier patches.
-
You can think of elliptical as a circle which was "stretched" on one of the dimensions. Now, "stretch" is linear since the conversion and the bezier function is linear on the control point, you can calculate the control points for the beijer curve, which estimates the 90 degree circle arc, then "stretch" control points To transform on, and apply the volume, you get the control point for the "Beverage Curve", which estimates the "90 degree" Alpeas arc. Repeating the entire oval recovery process four times.
Comments
Post a Comment