We are about to switch to a new forum software. Until then we have removed the registration on this forum.
The line has 3 segments:
Let's say I have a method
float length(int segment) {
// returns length of segment
}
Then should I start counting at 0 (like 0,1,2)? Or start at 1 (1,2,3)?
Answers
Generally I would suggest that you start at 0 since the first element in ANY sequential Java collection or array is zero.
For a more informative answer you might explain how are you storing the segment data e.g. an array of vertices, or a class to hold segment data or something else.
length is 3. but if the lines are numbered they are lines 0, 1, 2.
but what is 'segment' argument for?
thx zero it is.
segment, is what part of the line you mean.