Re: [Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-08-06 Thread Andrew Coppin
mo...@deepbondi.net wrote: How embarrassing, I managed to get this simple math wrong. That's what I get for trying to think in the morning without either my notes or my coffee, I suppose. I _said_ it was tricky, didn't I? ;-) ___ Haskell-Cafe mailin

Re: [Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-08-06 Thread mokus
mo...@deepbondi.net wrote: > It took me a while to get the intuition right on those, but here's a quick > sketch. Let n = number of control points, m = number of knots, and p = > degree. For p = 0 (constant segments), each control point corresponds to > one span of the knot vector, so n = m - 1.

Re: [Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-08-06 Thread James Andrew Cook
On Aug 5, 2010, at 4:31 PM, Andrew Coppin wrote: > mo...@deepbondi.net wrote: >> Andrew Coppin wrote: >> >>> Given a suitable definition for Vector2 (i.e., a 2D vector with the >>> appropriate classes), it is delightfully trivial to implement de >>> Casteljau's algorithm: >>> >>> de_Casteljau :

Re: [Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-08-05 Thread Andrew Coppin
mo...@deepbondi.net wrote: Andrew Coppin wrote: Given a suitable definition for Vector2 (i.e., a 2D vector with the appropriate classes), it is delightfully trivial to implement de Casteljau's algorithm: de_Casteljau :: Scalar -> [Vector2] -> [[Vector2]] de_Casteljau t [p] = [[p]] de_Castelj

Re: [Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-07-24 Thread mokus
Andrew Coppin wrote: > Given a suitable definition for Vector2 (i.e., a 2D vector with the > appropriate classes), it is delightfully trivial to implement de > Casteljau's algorithm: > > de_Casteljau :: Scalar -> [Vector2] -> [[Vector2]] > de_Casteljau t [p] = [[p]] > de_Casteljau t ps = ps : de_Ca

[Haskell-cafe] Wildly off-topic: de Boor's algorithm

2010-07-15 Thread Andrew Coppin
Given a suitable definition for Vector2 (i.e., a 2D vector with the appropriate classes), it is delightfully trivial to implement de Casteljau's algorithm: de_Casteljau :: Scalar -> [Vector2] -> [[Vector2]] de_Casteljau t [p] = [[p]] de_Casteljau t ps = ps : de_Casteljau t (zipWith (line t) ps