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:

  1. 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.

  2. 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 . / P>

Unless the math is corrected, you can not go to the next step (coding).


Edit:

  1. Since you need an entire ellipse, I want two or two instead of a bezier curve I would advise to use four bezier patches.

  2. 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

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -