POV-Ray : Newsgroups : povray.advanced-users : Some math aid required... : Re: Some math aid required... Server Time
29 Jul 2024 02:33:38 EDT (-0400)
  Re: Some math aid required...  
From: sascha
Date: 11 Feb 2004 03:05:23
Message: <4029e243$1@news.povray.org>
Christopher James Huff wrote:

> B0(t) = (1 - t)^2
> B1(t) = 2*t*(1 - t)
> B2(t) = t^2
> 
> n0 = p1 - p0
> n1 = p2 - p1
> n2 = p3 - p2
> 
> n(t) = n0*B0(t) + n1*B1(t) + n2*B2(t)
> =
> (p1 - p0)*(1 - t)^2 + (p2 - p1)*2*t*(1 - t) + (p3 - p2)*t^2
> 
> But this does not work at all...
> 

Sure it does!

Take a look at the image at http://192.94.226.61/decasteljau.png

it shows a bezier curve defined by p0,p1,p2,p3 and the deCasteljau construction
of point P at t = 3/4 (just as an example).

The tangent through P is, as we can see, the vector b - a.

Ok, let's take a closer look:

first, let's construct the points x,y and z

x = p0(1-t) + p1t
y = p1(1-t) + p2t
z = p2(1-t) + p3t

now we can construct a and b

a = x(1-t) + yt =
  = p0(1-t)^2 + p1t(1-t) + p1(1-t)t + p2t^2 =
  = p0(1-t)^2 + p1*2t(1-t) + p2t^2

b = y(1-t) + zt =
  = p1(1-t)^2 + p2t(1-t) + p2(1-t)t + p3t^2 =
  = p1(1-t)^2 + p2*2t(1-t) + p3t^2

our tangent is b - a =
  = p1(1-t)^2 + p2*2t(1-t) + p3t^2 - p0(1-t)^2 - p1*2t(1-t) - p2t^2 =
  = (p1-p0)(1-t)^2 + (p2-p1)*2t(1-t) + (p3-p2)t^2

Q.E.D


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.