DELIMITER $$
CREATE PROCEDURE northeastranges.asdf(IN lat1 INT,IN lon1 INT,IN lat2 INT,IN lon2 INT)
BEGIN
SELECT ( 3959 * ACOS( COS( RADIANS(lat1) ) * COS( RADIANS( lat2 ) ) * COS( RADIANS( lon2 ) - RADIANS(lon1) ) + SIN( RADIANS(lat1) ) * SIN( RADIANS( lat2 ) ) ) );
END$$
DELIMITER ;
there definately seems to be a logical error in the code, because the following data provides the responses beside them:CALL asdf(42.20264,-71.43606,42.25390,-71.45835) Yeilds: 0 CALL asdf(42.253909,-71.45835,42.711545,-71.16700) Yeilds: 69.097585086449 CALL asdf(42.151363,-71.42172,42.166938,-71.36069) Yeilds: 0None of which are correct...
can anyone offer me any insight as to whats going wrong here?


Sign In
Create Account

Back to top









