ELASTICPATHING/SOURCECODE/UbiComp2014/Get_Map_Code/lib-Dist.rb
#A 2 point interpolation class. The interface is designed to mimic that of spline.
A 2 point interpolation class. The interface is designed to mimic that of spline.
A 2 point interpolation class . The interface is designed to mimic that of spline .
def deriv_point(index)
		lat_diff = (@coords[@max_ind][0] - @coords[@min_ind][0])
		lon_diff = (@coords[@max_ind][1] - @coords[@min_ind][1])
		time_diff = (@coords[@max_ind][2] - @coords[@min_ind][2])
		return [lat_diff/time_diff, lon_diff/time_diff]
	end
def deriv_point ( index ) lat_diff = ( @coords [ @max_ind ] [ 0 ] - @coords [ @min_ind ] [ 0 ] ) lon_diff = ( @coords [ @max_ind ] [ 1 ] - @coords [ @min_ind ] [ 1 ] ) time_diff = ( @coords [ @max_ind ] [ 2 ] - @coords [ @min_ind ] [ 2 ] ) return [ lat_diff / time_diff , lon_diff / time_diff ] end
A 2 point interpolation class.
A 2 point interpolation class .
#linear 1st derivative = slope (constant)
index