I need to split a line into multiple equal parts (so each part can be individually colour coded). I have a couple of questions :
1) Has anyone come across c# code to do this already?
2) Am I right in assuming that I can use normal 'flat' trigonometry to work out where to split the line? I'm going to assume all the lines have an altitude of 0.
This depends on what you are trying to accomplish, and how accurate you need to be and how you plan to measure distance for the point of view of splitting the line?
In any event the steps would look like this:
Total
)Segment
P_less
has you less thanSegment
, and the next pointP_more
is greater thanSegment
(check the edge case of the current point falls right on the segment distance)P_less
andP_more
which provides the exact target segment distance.