public Vertex interpolateAll ( List < Vertex > vertexes , int r , int index , double t ) { if ( vertexes . size ( ) == 1 ) return vertexes . get ( 0 ) ; if ( r == 0 ) return vertexes . get ( index ) ; Vertex v1 = interpolateAll ( vertexes , r - 1 , index , t ) ; Vertex v2 = interpolateAll ( vertexes , r - 1 , index + 1 , t ) ; return interpolate ( v1 , v2 , t ) ; }
Interpolate the vertexes places .