How do I calculate the normal vector of a line segment? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 5 months ago. The community reviewed whether to reopen this question 5 months ago and left it closed: Original close reason(s) were … Read more

Why can’t decimal numbers be represented exactly in binary?

There have been several questions posted to SO about floating-point representation. For example, the decimal number 0.1 doesn’t have an exact binary representation, so it’s dangerous to use the == operator to compare it to another floating-point number. I understand the principles behind floating-point representation. What I don’t understand is why, from a mathematical perspective, … Read more

Calculate distance between 2 GPS coordinates

How do I calculate distance between two GPS coordinates (using latitude and longitude)? 31 Answers 31 Calculate the distance between two coordinates by latitude and longitude, including a Javascript implementation. West and South locations are negative. Remember minutes and seconds are out of 60 so S31 30′ is -31.50 degrees. Don’t forget to convert degrees … Read more