Comment by brabel

1 year ago

> There are 360 degrees in a circle, and the first entry is 0 degrees.

To be pedantic, "first" is associated with 1. And a circle does not have a "first" entry, whatever you mean by entry. I think what you're trying to say is that a circle is a continuous arc going from 0 to 360 degrees, but you should recognize that the "starting point" is arbitrary, any point will do, so there isn't really a "first", and that this is not the same as counting because counting is done with natural numbers, which are non-continuous. The problem of 0 VS 1 makes sense only in counting exactly because it's subjective whether you prefer to count from 0 or from 1. Because zero is the absence of anything, I find it hard to start counting from 0 (when you do, your "first" item is actually your zeroth item, and the next item would be the "first"??!), to be honest, despite being completely familiar with doing so since I've used 0-index programming languages my whole life.

If you cut up a circle into n slices (maybe you're drawing a diagram on screen), it's vastly more helpful to think of one of the segments as segment 0 because then the start angle of every segment is index*360/n and the two segments whose border is at your initial angle are the first and last. If you start counting segments at 1, your “first” segment would be some way into the circle, and the two segments whose border is at your initial angle would be the last and the second-last.

  • Don't you see that what you're talking about is a range, not counting?? A range indeed starts at a zero point because if you don't have another point, you just have an empty range: and that's the equivalent of a zero range. When you have two points in a range, then the "first" point ends up being zero, that's correct, because it's being treated as the beginning of it. An "origin" is always associated with zero. It's perhaps incorrect to use the word "first" in this case exactly because it "breaks" how ordinals actually work (i.e. 1=first, 2=second, etc.). A better word is the "initial" point of a range, and the "other" point is the "final" point. Each segment you consider will be a pair [initial, final]. Here's where your mistake comes in: you assume that you can just take each segment and assign it a single number, but instead of using the ordinal numbers which start from 1, you decided to, arbitrarily, take the initial point of the range as your number instead, which is where the zero comes from. Notice that the zero you chose comes from the pair [initial, final], but the zero only makes sense when it's in a pair (alone, zero means the absence of something, i.e. there's no range... I thought that concept was well understood at least by fellow programmers, but apparently not).

    • I really don't see how your comment helps reduce complexity. It seems to me that you're introducing a new concept, “ranges”, just to maintain traditional 1-based ordinals, instead of realizing that when you count from 0, counting and ranges simply become the same thing and you don't need such a distinction.

No, "first" infers a sequence and is associated with the beginning of that sequence. In the case of a relative heading, the existing heading is 0 degrees. Any change is relative to that origin point. Zero is also not the absence of anything, that would more properly be considered a NULL or NaN.