コード例 #1
0
 static public IEnumerable <T> SubdividePathByDivisions <T>(this IEnumerable <T> item, int divisions, Operation <T, T, T, float> interpolate_operation)
 {
     return(item.ConvertConnections(delegate(T sub_item1, T sub_item2) {
         return Floats.Line(0.0f, 1.0f, divisions, false)
         .Convert(f => interpolate_operation(sub_item1, sub_item2, f));
     }));
 }
コード例 #2
0
        static public IEnumerable <T> SubdividePathToLength <T>(this IEnumerable <T> item, float maximum_inter_length, Operation <float, T, T> distance_operation, Operation <T, T, T, float> interpolate_operation)
        {
            return(item.ConvertConnections(delegate(T sub_item1, T sub_item2) {
                float length = distance_operation(sub_item1, sub_item2);

                if (length > maximum_inter_length)
                {
                    int number_divisions = Mathq.CeilToInt(length / maximum_inter_length);

                    return Floats.Line(0.0f, 1.0f, number_divisions, false)
                    .Convert(f => interpolate_operation(sub_item1, sub_item2, f));
                }

                return sub_item1.WrapAsEnumerable();
            }));
        }
コード例 #3
0
 static public void ProcessWithFloatsLine <T>(this ICollection <T> item, float start, float end, bool include_end, Process <float, T> process)
 {
     Floats.Line(start, end, item.Count, include_end).ProcessTandemStrict(item, process);
 }