     POV-Ray : Newsgroups : povray.object-collection : Sphere Sweep 1.2 Quadratic spline question : Re: Sphere Sweep 1.2 Quadratic spline question - STOP THE PRESS! Server Time: 26 Oct 2020 13:31:37 GMT  Re: Sphere Sweep 1.2 Quadratic spline question - STOP THE PRESS!    From: Cousin Ricky Date: 8 Sep 2020 21:09:40    ```On 2020-09-08 2:32 PM (-4), Bald Eagle wrote:
>
> The initial suggestion was to do:
>>>     Â  array { P1, P2, P2, P3 },
> (seemed totally reasonable to me, and seemed to give good results)

Seemed totally reasonable to me, too, which is why I made that mistake.
But human brains are notoriously bad at math.

> So what I'm asking is: why aren't ALL 3 control points appearing as terms in the
> equations for each of the array elements?
>
> I'm not doubting that the correction you're proposing is right, I'd just like
> you to articulate, for my own benefit, why, in light of the corrections to the
> 2nd and 3rd elements, the first and last elements are still solitary control
> points, and why the second doesn't have a term for P3, and the third doesn't
> have a term for P1.

The end points are the same for both methods, right?  So why would they
need any influence from the other points?

As for the 2nd and 3rd points, I think they are best explained with an
illustration:

P1 and P3 are the gray circles, and P2 is the magenta circle.  The 2nd
and 3rd cubic points are the yellow circles, and the quadratic curve is
the yellow curve with the black border.  You can see that the 2nd point
is on the line between P1 and P2, which needs no input from P3; and the
3rd point is on the line between P2 and P3, which needs no input from P1.

Each point on the cubic BÃ©zier curve is computed as:
P(t) = (1-t)Â³*P1 + 3*(1-t)Â²*t*P2 + 3*(1-t)*tÂ²*P3 + tÂ³*P4

As this one formula includes all 4 control points, all the curve needs
is for each of the quadratic points to be accounted for in _at least_
one cubic point.  There is simply no need for each of the cubic points
to include all 3 of the quadratic points.
```    