Displaying 1 result from an estimated 1 matches for "delta_rad".
Did you mean:
delta_prod
2012 Apr 08
0
multithreaded low level functions
...th(pointY)))
#print(sprintf("Len Vec X: %d Len Vec Y: %d", length(vecX),length(vecY)))
#print(sprintf("Len delta_lon: %d", length(delta_lon)))
R = 6372.8 #Radius of the earth (km)
#spherical law of cosines:
#acos(sin(lat)*sin(lat) + cos(lat)*cos(lat)*cos(delta lon))
delta_rad = acos(sin(pointY)*sin(vecY) +
cos(pointY)*cos(vecY)*cos(delta_lon))
delta_km = R*delta_rad
return(delta_km)
}
vecX and vecY are very large, about 500k elements or more. I want to know
the most efficient way to write this function. I don't even need to do
lapply or an apply function for th...