(Assuming this is related to programming, as the link indicates.)
If you give each segment a consistent orientation (just a choice of ordering on the two endpoints), then you will always be able to tell 'inside' from 'outside'. For example, suppose I have a segment oriented ($a$, $b$), where $a$ and $b$ are endpoints. Then I want to introduce trisecting points a' and b' (so the order I have in mind is $a$, a', b', $b$), then I choose $c$ not on the segment so that a'c has the same length as b'c. Of course there are two such points $c$ (hence the question, right?). Let $\mathbf{u} = \vec{ab}$ and $\mathbf{v} = \vec{ac}$. We must choose $c$ so that the acute angle between $\mathbf{u}$ and $\mathbf{v}$ is swept out from $\mathbf{u}$ to $\mathbf{v}$ in a counterclockwise direction. One way to do this is to consider $\mathbf{u}, \mathbf{v}$ as 3-dimensional vectors with 0 component in the $z$ direction. Then take the cross product $\mathbf{u} \times \mathbf{v}$. If the result has a positive $z$-component, then the choice of $c$ was correct, while if it is negative, then other choice of $c$ was incorrect -- choose the other one. Note, since both $\mathbf{u}, \mathbf{v}$ live on the $xy$-plane, their cross product will only have a $z$-component. Also note, it is essential to know the order of $a$ and $b$ for this to work. To prepare for the next iteration, orient the new segments thus: (a, a'), (a', c), (c, b'), (b', b).
Hope this helps!