Esempio n. 1
0
        public FunctionTableSegment(float s, float e, int d, Operation <float, float> o)
        {
            number_entrys      = d.CalculateContainerPOT();
            number_entrys_mask = number_entrys - 1;

            step_value = (e - s) / number_entrys;

            entrys = Floats.Range(s, e, step_value, false)
                     .Convert(f => new FunctionTableSegmentEntry(f, step_value, o))
                     .ToArray();
        }
Esempio n. 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();
            }));
        }
Esempio n. 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);
 }
Esempio n. 4
0
 static public void ProcessWithFloatsRay <T>(this ICollection <T> item, float start, float step, Process <float, T> process)
 {
     Floats.Ray(start, step, item.Count).ProcessTandemStrict(item, process);
 }