Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcupt1!schi From: schi@hpcupt1.HP.COM (Shan Chi) Newsgroups: comp.graphics Subject: Re: Bezier curves Message-ID: <6350003@hpcupt1.HP.COM> Date: 14 Sep 89 16:57:46 GMT References: <273@marvin.moncam.co.uk> Organization: Hewlett Packard, Cupertino Lines: 40 I must have been dreaming while I was reading the question. The previous response by me was only for the case when the splitting point is at t=0.5. Now here is what I think the right answer. ----------------------------------------------------------------------------- Let the Bezier curve be P(t) = T M P, 0 <= t <= 1 where T = [t^3 t^2 t 1], M = [-1 3 -3 1] and P = [ P0 ] [3 -6 3 0] [ P1 ] [-3 3 0 0] [ P2 ] [ 1 0 0 0] [ P3 ] Suppose we split at t=x, then the two new curves are: Q(t) = P(xt) = T Dq M P, 0 <= t <= 1, and R(t) = P((1-x)t+x) = T Dr M P, 0 <= t <= 1 where Dq = [x^3 0 0 0] and Rq = [(1-x)^3 0 0 0] [0 x^2 0 0] [3x(1-x)^2 (1-x)^2 0 0] [0 0 x 0] [3(1-x)x^2 2x(1-x) (1-x) 0] [0 0 0 1] [x^3 x^2 x0 1] Now we rearrange them into Bezier form. Q(t) = T M M^-1 Dq M P = T M (M^-1 Dq M P), and R(t) = T M M^-1 Dr M P = T M (M^-1 Dr M P) where M^-1 is the inverse matrix of M. Therefore, Pq = M^-1 Dq M P, and Pr = M^-1 Dr M P are the two sets of new control points. Note that (M^-1 Dq M) and (M^-1 Dr M) are functions of x and can be pre-computed if x is relatively constant. Hope this time I am not dreaming. :-)