sorry its in obj-c, but nothing too complicated if any syntax confuses you let me know.
- (void) CosineLerp
{
float detailBias = 0.1;
for( int i = 0; i < [_pointArray count]-2; ++i )
{
CGPoint p0,p1;
p0 = [[_pointArray objectAtIndex:i]CGPointValue];
p1 = [[_pointArray objectAtIndex:i+1]CGPointValue];
float count = 0;
do
{
float t = count * M_PI;
float g = (1- cosf(t))*0.5;
CGPoint temp = ccp( (p0.x*(1-g)+p1.x*g),(p0.y*(1.f-g)+p1.y*g) );
[_bezierArray addObject:[NSValue valueWithCGPoint:temp]];
count += detailBias;
} while (count <= 1.f);
}
}






